Bug#1008369: scikit-learn: FTBFS: dh_auto_test: error: pybuild --test -i python{version} -p "3.10 3.9" returned exit code 13
Lucas Nussbaum
lucas at debian.org
Sat Mar 26 20:39:15 GMT 2022
Source: scikit-learn
Version: 1.0.2-1
Severity: serious
Justification: FTBFS
Tags: bookworm sid ftbfs
User: lucas at debian.org
Usertags: ftbfs-20220326 ftbfs-bookworm
Hi,
During a rebuild of all packages in sid, your package failed to build
on amd64.
Relevant part (hopefully):
> =================================== FAILURES ===================================
> __________________________ test_docstring_parameters ___________________________
>
> @pytest.mark.filterwarnings("ignore::FutureWarning")
> @pytest.mark.filterwarnings("ignore::DeprecationWarning")
> @pytest.mark.skipif(IS_PYPY, reason="test segfaults on PyPy")
> def test_docstring_parameters():
> # Test module docstring formatting
>
> # Skip test if numpydoc is not found
> pytest.importorskip(
> "numpydoc", reason="numpydoc is required to test the docstrings"
> )
>
> # XXX unreached code as of v0.22
> from numpydoc import docscrape
>
> incorrect = []
> for name in PUBLIC_MODULES:
> if name.endswith(".conftest"):
> # pytest tooling, not part of the scikit-learn API
> continue
> if name == "sklearn.utils.fixes":
> # We cannot always control these docstrings
> continue
> with warnings.catch_warnings(record=True):
> module = importlib.import_module(name)
> classes = inspect.getmembers(module, inspect.isclass)
> # Exclude non-scikit-learn classes
> classes = [cls for cls in classes if cls[1].__module__.startswith("sklearn")]
> for cname, cls in classes:
> this_incorrect = []
> if cname in _DOCSTRING_IGNORES or cname.startswith("_"):
> continue
> if inspect.isabstract(cls):
> continue
> with warnings.catch_warnings(record=True) as w:
> cdoc = docscrape.ClassDoc(cls)
> if len(w):
> > raise RuntimeError(
> "Error for __init__ of %s in %s:\n%s" % (cls, name, w[0])
> )
> E RuntimeError: Error for __init__ of <class 'sklearn.calibration.CalibrationDisplay'> in sklearn.calibration:
> E {message : UserWarning('potentially wrong underline length... \nParameters \n----------- in \nCalibration curve (also known as reliability diagram) visualization.\n... in the docstring of CalibrationDisplay in /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/sklearn/calibration.py.'), category : 'UserWarning', filename : '/usr/lib/python3/dist-packages/numpydoc/docscrape.py', lineno : 434, line : None}
>
> sklearn/tests/test_docstring_parameters.py:103: RuntimeError
> _________________ test_check_docstring_parameters[mock_meta0] __________________
>
> mock_meta = <sklearn.utils.tests.test_testing.MockMetaEstimator object at 0x7fdc7943edc0>
>
> @pytest.mark.parametrize(
> "mock_meta",
> [
> MockMetaEstimator(delegate=MockEst()),
> MockMetaEstimatorDeprecatedDelegation(delegate=MockEst()),
> ],
> )
> def test_check_docstring_parameters(mock_meta):
> pytest.importorskip(
> "numpydoc", reason="numpydoc is required to test the docstrings"
> )
>
> incorrect = check_docstring_parameters(f_ok)
> assert incorrect == []
> incorrect = check_docstring_parameters(f_ok, ignore=["b"])
> assert incorrect == []
> incorrect = check_docstring_parameters(f_missing, ignore=["b"])
> assert incorrect == []
> with pytest.raises(RuntimeError, match="Unknown section Results"):
> check_docstring_parameters(f_bad_sections)
> with pytest.raises(RuntimeError, match="Unknown section Parameter"):
> > check_docstring_parameters(Klass.f_bad_sections)
>
> sklearn/utils/tests/test_testing.py:540:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> func = <function Klass.f_bad_sections at 0x7fdc7966f670>
> doc = <numpydoc.docscrape.FunctionDoc object at 0x7fdc6184dac0>, ignore = []
>
> def check_docstring_parameters(func, doc=None, ignore=None):
> """Helper to check docstring.
>
> Parameters
> ----------
> func : callable
> The function object to test.
> doc : str, default=None
> Docstring if it is passed manually to the test.
> ignore : list, default=None
> Parameters to ignore.
>
> Returns
> -------
> incorrect : list
> A list of string describing the incorrect results.
> """
> from numpydoc import docscrape
>
> incorrect = []
> ignore = [] if ignore is None else ignore
>
> func_name = _get_func_name(func)
> if not func_name.startswith("sklearn.") or func_name.startswith(
> "sklearn.externals"
> ):
> return incorrect
> # Don't check docstring for property-functions
> if inspect.isdatadescriptor(func):
> return incorrect
> # Don't check docstring for setup / teardown pytest functions
> if func_name.split(".")[-1] in ("setup_module", "teardown_module"):
> return incorrect
> # Dont check estimator_checks module
> if func_name.split(".")[2] == "estimator_checks":
> return incorrect
> # Get the arguments from the function signature
> param_signature = list(filter(lambda x: x not in ignore, _get_args(func)))
> # drop self
> if len(param_signature) > 0 and param_signature[0] == "self":
> param_signature.remove("self")
>
> # Analyze function's docstring
> if doc is None:
> with warnings.catch_warnings(record=True) as w:
> try:
> doc = docscrape.FunctionDoc(func)
> except Exception as exp:
> incorrect += [func_name + " parsing error: " + str(exp)]
> return incorrect
> if len(w):
> > raise RuntimeError("Error for %s:\n%s" % (func_name, w[0]))
> E RuntimeError: Error for sklearn.utils.tests.test_testing.Klass.f_bad_sections:
> E {message : UserWarning('potentially wrong underline length... \nParameter \n---------- in \nFunction f\n... in the docstring of f_bad_sections in /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/sklearn/utils/tests/test_testing.py.'), category : 'UserWarning', filename : '/usr/lib/python3/dist-packages/numpydoc/docscrape.py', lineno : 434, line : None}
>
> sklearn/utils/_testing.py:665: RuntimeError
>
> During handling of the above exception, another exception occurred:
>
> mock_meta = <sklearn.utils.tests.test_testing.MockMetaEstimator object at 0x7fdc7943edc0>
>
> @pytest.mark.parametrize(
> "mock_meta",
> [
> MockMetaEstimator(delegate=MockEst()),
> MockMetaEstimatorDeprecatedDelegation(delegate=MockEst()),
> ],
> )
> def test_check_docstring_parameters(mock_meta):
> pytest.importorskip(
> "numpydoc", reason="numpydoc is required to test the docstrings"
> )
>
> incorrect = check_docstring_parameters(f_ok)
> assert incorrect == []
> incorrect = check_docstring_parameters(f_ok, ignore=["b"])
> assert incorrect == []
> incorrect = check_docstring_parameters(f_missing, ignore=["b"])
> assert incorrect == []
> with pytest.raises(RuntimeError, match="Unknown section Results"):
> check_docstring_parameters(f_bad_sections)
> with pytest.raises(RuntimeError, match="Unknown section Parameter"):
> > check_docstring_parameters(Klass.f_bad_sections)
> E AssertionError: Regex pattern 'Unknown section Parameter' does not match "Error for sklearn.utils.tests.test_testing.Klass.f_bad_sections:\n{message : UserWarning('potentially wrong underline length... \\nParameter \\n---------- in \\nFunction f\\n... in the docstring of f_bad_sections in /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/sklearn/utils/tests/test_testing.py.'), category : 'UserWarning', filename : '/usr/lib/python3/dist-packages/numpydoc/docscrape.py', lineno : 434, line : None}".
>
> sklearn/utils/tests/test_testing.py:540: AssertionError
> _________________ test_check_docstring_parameters[mock_meta1] __________________
>
> mock_meta = <sklearn.utils.tests.test_testing.MockMetaEstimatorDeprecatedDelegation object at 0x7fdc7943ed30>
>
> @pytest.mark.parametrize(
> "mock_meta",
> [
> MockMetaEstimator(delegate=MockEst()),
> MockMetaEstimatorDeprecatedDelegation(delegate=MockEst()),
> ],
> )
> def test_check_docstring_parameters(mock_meta):
> pytest.importorskip(
> "numpydoc", reason="numpydoc is required to test the docstrings"
> )
>
> incorrect = check_docstring_parameters(f_ok)
> assert incorrect == []
> incorrect = check_docstring_parameters(f_ok, ignore=["b"])
> assert incorrect == []
> incorrect = check_docstring_parameters(f_missing, ignore=["b"])
> assert incorrect == []
> with pytest.raises(RuntimeError, match="Unknown section Results"):
> check_docstring_parameters(f_bad_sections)
> with pytest.raises(RuntimeError, match="Unknown section Parameter"):
> > check_docstring_parameters(Klass.f_bad_sections)
>
> sklearn/utils/tests/test_testing.py:540:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> func = <function Klass.f_bad_sections at 0x7fdc7966f670>
> doc = <numpydoc.docscrape.FunctionDoc object at 0x7fdc619a9760>, ignore = []
>
> def check_docstring_parameters(func, doc=None, ignore=None):
> """Helper to check docstring.
>
> Parameters
> ----------
> func : callable
> The function object to test.
> doc : str, default=None
> Docstring if it is passed manually to the test.
> ignore : list, default=None
> Parameters to ignore.
>
> Returns
> -------
> incorrect : list
> A list of string describing the incorrect results.
> """
> from numpydoc import docscrape
>
> incorrect = []
> ignore = [] if ignore is None else ignore
>
> func_name = _get_func_name(func)
> if not func_name.startswith("sklearn.") or func_name.startswith(
> "sklearn.externals"
> ):
> return incorrect
> # Don't check docstring for property-functions
> if inspect.isdatadescriptor(func):
> return incorrect
> # Don't check docstring for setup / teardown pytest functions
> if func_name.split(".")[-1] in ("setup_module", "teardown_module"):
> return incorrect
> # Dont check estimator_checks module
> if func_name.split(".")[2] == "estimator_checks":
> return incorrect
> # Get the arguments from the function signature
> param_signature = list(filter(lambda x: x not in ignore, _get_args(func)))
> # drop self
> if len(param_signature) > 0 and param_signature[0] == "self":
> param_signature.remove("self")
>
> # Analyze function's docstring
> if doc is None:
> with warnings.catch_warnings(record=True) as w:
> try:
> doc = docscrape.FunctionDoc(func)
> except Exception as exp:
> incorrect += [func_name + " parsing error: " + str(exp)]
> return incorrect
> if len(w):
> > raise RuntimeError("Error for %s:\n%s" % (func_name, w[0]))
> E RuntimeError: Error for sklearn.utils.tests.test_testing.Klass.f_bad_sections:
> E {message : UserWarning('potentially wrong underline length... \nParameter \n---------- in \nFunction f\n... in the docstring of f_bad_sections in /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/sklearn/utils/tests/test_testing.py.'), category : 'UserWarning', filename : '/usr/lib/python3/dist-packages/numpydoc/docscrape.py', lineno : 434, line : None}
>
> sklearn/utils/_testing.py:665: RuntimeError
>
> During handling of the above exception, another exception occurred:
>
> mock_meta = <sklearn.utils.tests.test_testing.MockMetaEstimatorDeprecatedDelegation object at 0x7fdc7943ed30>
>
> @pytest.mark.parametrize(
> "mock_meta",
> [
> MockMetaEstimator(delegate=MockEst()),
> MockMetaEstimatorDeprecatedDelegation(delegate=MockEst()),
> ],
> )
> def test_check_docstring_parameters(mock_meta):
> pytest.importorskip(
> "numpydoc", reason="numpydoc is required to test the docstrings"
> )
>
> incorrect = check_docstring_parameters(f_ok)
> assert incorrect == []
> incorrect = check_docstring_parameters(f_ok, ignore=["b"])
> assert incorrect == []
> incorrect = check_docstring_parameters(f_missing, ignore=["b"])
> assert incorrect == []
> with pytest.raises(RuntimeError, match="Unknown section Results"):
> check_docstring_parameters(f_bad_sections)
> with pytest.raises(RuntimeError, match="Unknown section Parameter"):
> > check_docstring_parameters(Klass.f_bad_sections)
> E AssertionError: Regex pattern 'Unknown section Parameter' does not match "Error for sklearn.utils.tests.test_testing.Klass.f_bad_sections:\n{message : UserWarning('potentially wrong underline length... \\nParameter \\n---------- in \\nFunction f\\n... in the docstring of f_bad_sections in /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/sklearn/utils/tests/test_testing.py.'), category : 'UserWarning', filename : '/usr/lib/python3/dist-packages/numpydoc/docscrape.py', lineno : 434, line : None}".
>
> sklearn/utils/tests/test_testing.py:540: AssertionError
> = 3 failed, 24128 passed, 195 skipped, 1 deselected, 248 xfailed, 39 xpassed, 2386 warnings in 10221.46s (2:50:21) =
> E: pybuild pybuild:367: test: plugin distutils failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build; python3.9 -m pytest -m "not network" -v --color=no -k "not test_load_boston_alternative"
> dh_auto_test: error: pybuild --test -i python{version} -p "3.10 3.9" returned exit code 13
The full build log is available from:
http://qa-logs.debian.net/2022/03/26/scikit-learn_1.0.2-1_unstable.log
A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!
If you reassign this bug to another package, please marking it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects
If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.
More information about the debian-science-maintainers
mailing list