Bug#1147335: dolfin: using the removed pkg_resources module in the autopkg tests
Matthias Klose
doko at debian.org
Fri Sep 11 08:01:07 BST 2026
Package: src:dolfin
Version: 2019.2.0~legacy20240219.1c52e83-30
Severity: serious
Tags: sid forky
User: debian-python at lists.debian.org
Usertags: pkg-resources-deprecation
using the removed pkg_resources module in the autopkg tests:
[...]
4189s ----------------------------- Captured stdout call
-----------------------------
4189s DEPRECATION: the --wheel and --no-wheel options do nothing;
virtualenv no longer bundles wheel. They will be removed in a release
after 2026-12. Stop passing them.
4189s _
test_dolfin_import_success_with_allowed_local_packages[dependencies_import_name0-dependencies_pypi_name0]
_
4189s
4189s dependencies_import_name = ['ufl_legacy']
4189s dependencies_pypi_name = ['fenics-ufl-legacy']
4189s
4189s @pytest.mark.skipif(not has_internet, reason="Requires
downloading from pypi.org")
4189s
@pytest.mark.parametrize("dependencies_import_name,dependencies_pypi_name",
[
4189s (["ufl_legacy"], ["fenics-ufl-legacy"]),
4189s (["ufl"], ["fenics-ufl"])
4189s ])
4189s def test_dolfin_import_success_with_allowed_local_packages(
4189s dependencies_import_name: typing.List[str],
dependencies_pypi_name: typing.List[str]
4189s ) -> None:
4189s """Test that dolfin imports correctly even with extra
local packages when asked to allow user-site imports."""
4189s > assert_package_import_success_with_allowed_local_packages(
4189s "dolfin",
"/usr/lib/petsc/lib/python3/dist-packages/dolfin/__init__.py",
4189s dependencies_import_name, dependencies_pypi_name,
pip_install_call
4189s )
4189s
4189s python/test/debian-only/test_pusimp.py:79:
4189s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _
4189s /usr/lib/python3/dist-packages/pusimp/utils.py:262: in
assert_package_import_success_with_allowed_local_packages
4189s assert_package_location(
4189s /usr/lib/python3/dist-packages/pusimp/utils.py:47: in
assert_package_location
4189s assert_has_package(executable, package)
4189s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _
4189s
4189s executable = '/tmp/tmpji015tbr/venv/bin/python3', package =
'ufl_legacy'
4189s
4189s def assert_has_package(executable: str, package: str) -> None:
4189s """Assert that a package is installed.
4189s
4189s Note that it is not safe to simply import the package in
the current pytest environment,
4189s since the environment itself might change from one test to
the other, but python packages
4189s can be imported only once and not unloaded.
4189s """
4189s run_import = subprocess.run(f"{executable} -c 'import
{package}'", shell=True, capture_output=True)
4189s > assert run_import.returncode == 0, (
4189s ^^^^^^^^^^^^^^^^^^^^^^^^^^
4189s f"Importing {package} was not successful.\n"
4189s f"stdout contains {run_import.stdout.decode().strip()}\n"
4189s f"stderr contains {run_import.stderr.decode().strip()}"
4189s )
4189s E AssertionError: Importing ufl_legacy was not successful.
4189s E stdout contains
4189s E stderr contains Traceback (most recent call last):
4189s E File "<string>", line 1, in <module>
4189s E import ufl_legacy
4189s E File
"/tmp/tmpji015tbr/venv/lib/python3.14/site-packages/ufl_legacy/__init__.py",
line 243, in <module>
4189s E import pkg_resources
4189s E ModuleNotFoundError: No module named 'pkg_resources'
4189s
4189s /usr/lib/python3/dist-packages/pusimp/utils.py:32: AssertionError
4189s ----------------------------- Captured stdout call
-----------------------------
4189s DEPRECATION: the --wheel and --no-wheel options do nothing;
virtualenv no longer bundles wheel. They will be removed in a release
after 2026-12. Stop passing them.
4189s =========================== short test summary info
============================
4189s FAILED
python/test/debian-only/test_pusimp.py::test_dolfin_import_errors_with_local_packages[dependencies_import_name0-dependencies_pypi_name0-dependencies_extra_error_message0]
4189s FAILED
python/test/debian-only/test_pusimp.py::test_dolfin_import_errors_with_local_packages[dependencies_import_name2-dependencies_pypi_name2-dependencies_extra_error_message2]
4189s FAILED
python/test/debian-only/test_pusimp.py::test_dolfin_import_errors_with_local_packages[dependencies_import_name3-dependencies_pypi_name3-dependencies_extra_error_message3]
4189s FAILED
python/test/debian-only/test_pusimp.py::test_dolfin_import_success_with_allowed_local_packages[dependencies_import_name0-dependencies_pypi_name0]
4189s =================== 4 failed, 6 passed in 112.34s (0:01:52)
====================
More information about the debian-science-maintainers
mailing list