Path: csiph.com!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!feeds.phibee-telecom.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod From: Florian Weimer Newsgroups: linux.debian.maint.python Subject: dh_auto_test failure with pybuild due to missing PYTHONPATH Date: Sun, 04 Oct 2020 10:30:01 +0200 Message-ID: X-Mailbox-Line: From debian-python-request@lists.debian.org Sun Oct 4 08:21:37 2020 Old-Return-Path: X-Amavis-Spam-Status: No, score=-9.28 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, LDO_WHITELIST=-5, MURPHY_DRUGS_REL8=0.02, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham autolearn_force=no X-Policyd-Weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 CL_IP_EQ_FROM_MX=-3.1; rate: -4.6 MIME-Version: 1.0 Content-Type: text/plain X-Mailing-List: archive/latest/18670 List-ID: List-URL: List-Archive: https://lists.debian.org/msgid-search/87362ubdvh.fsf@mid.deneb.enyo.de Approved: robomod@news.nic.it Lines: 95 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Sun, 04 Oct 2020 10:21:22 +0200 X-Original-Message-ID: <87362ubdvh.fsf@mid.deneb.enyo.de> Xref: csiph.com linux.debian.maint.python:12911 I'm trying to package git-pw, and running the test suite fails like this: dh_auto_test -O--buildsystem=pybuild I: pybuild base:217: cd /build/git-pw-2.0.0/.pybuild/cpython3_3.8_git-pw/build; python3.8 -m pytest tests =========================================== test session starts =========================================== platform linux -- Python 3.8.6, pytest-4.6.11, py-1.9.0, pluggy-0.13.0 rootdir: /build/git-pw-2.0.0 collected 0 items / 5 errors ================================================= ERRORS ================================================== __________________ ERROR collecting .pybuild/cpython3_3.8_git-pw/build/tests/test_api.py __________________ tests/test_api.py:6: in from git_pw import api git_pw/__init__.py:8: in __version__ = pkg_resources.get_distribution('git-pw').version /usr/lib/python3/dist-packages/pkg_resources/__init__.py:480: in get_distribution dist = get_provider(dist) /usr/lib/python3/dist-packages/pkg_resources/__init__.py:356: in get_provider return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0] /usr/lib/python3/dist-packages/pkg_resources/__init__.py:899: in require needed = self.resolve(parse_requirements(requirements)) /usr/lib/python3/dist-packages/pkg_resources/__init__.py:785: in resolve raise DistributionNotFound(req, requirers) E pkg_resources.DistributionNotFound: The 'git-pw' distribution was not found and is required by the application ________________ ERROR collecting .pybuild/cpython3_3.8_git-pw/build/tests/test_bundle.py _________________ tests/test_bundle.py:7: in from git_pw import bundle git_pw/__init__.py:8: in __version__ = pkg_resources.get_distribution('git-pw').version /usr/lib/python3/dist-packages/pkg_resources/__init__.py:480: in get_distribution dist = get_provider(dist) /usr/lib/python3/dist-packages/pkg_resources/__init__.py:356: in get_provider return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0] /usr/lib/python3/dist-packages/pkg_resources/__init__.py:899: in require needed = self.resolve(parse_requirements(requirements)) /usr/lib/python3/dist-packages/pkg_resources/__init__.py:785: in resolve raise DistributionNotFound(req, requirers) E pkg_resources.DistributionNotFound: The 'git-pw' distribution was not found and is required by the application _________________ ERROR collecting .pybuild/cpython3_3.8_git-pw/build/tests/test_patch.py _________________ tests/test_patch.py:9: in from git_pw import patch git_pw/__init__.py:8: in __version__ = pkg_resources.get_distribution('git-pw').version /usr/lib/python3/dist-packages/pkg_resources/__init__.py:480: in get_distribution dist = get_provider(dist) /usr/lib/python3/dist-packages/pkg_resources/__init__.py:356: in get_provider return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0] /usr/lib/python3/dist-packages/pkg_resources/__init__.py:899: in require needed = self.resolve(parse_requirements(requirements)) /usr/lib/python3/dist-packages/pkg_resources/__init__.py:785: in resolve raise DistributionNotFound(req, requirers) E pkg_resources.DistributionNotFound: The 'git-pw' distribution was not found and is required by the application ________________ ERROR collecting .pybuild/cpython3_3.8_git-pw/build/tests/test_series.py _________________ tests/test_series.py:7: in from git_pw import series git_pw/__init__.py:8: in __version__ = pkg_resources.get_distribution('git-pw').version /usr/lib/python3/dist-packages/pkg_resources/__init__.py:480: in get_distribution dist = get_provider(dist) /usr/lib/python3/dist-packages/pkg_resources/__init__.py:356: in get_provider return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0] /usr/lib/python3/dist-packages/pkg_resources/__init__.py:899: in require needed = self.resolve(parse_requirements(requirements)) /usr/lib/python3/dist-packages/pkg_resources/__init__.py:785: in resolve raise DistributionNotFound(req, requirers) E pkg_resources.DistributionNotFound: The 'git-pw' distribution was not found and is required by the application _________________ ERROR collecting .pybuild/cpython3_3.8_git-pw/build/tests/test_utils.py _________________ tests/test_utils.py:11: in from git_pw import utils git_pw/__init__.py:8: in __version__ = pkg_resources.get_distribution('git-pw').version /usr/lib/python3/dist-packages/pkg_resources/__init__.py:480: in get_distribution dist = get_provider(dist) /usr/lib/python3/dist-packages/pkg_resources/__init__.py:356: in get_provider return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0] /usr/lib/python3/dist-packages/pkg_resources/__init__.py:899: in require needed = self.resolve(parse_requirements(requirements)) /usr/lib/python3/dist-packages/pkg_resources/__init__.py:785: in resolve raise DistributionNotFound(req, requirers) E pkg_resources.DistributionNotFound: The 'git-pw' distribution was not found and is required by the application !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 5 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ========================================= 5 error in 0.40 seconds ========================================= E: pybuild pybuild:352: test: plugin distutils failed with: exit code=2: cd /build/git-pw-2.0.0/.pybuild/cpython3_3.8_git-pw/build; python3.8 -m pytest tests dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p 3.8 returned exit code 13 Apparently, the test suite expects PYTHONPATH to be set. Is there a way to achieve this in a clean way? Adding this to debian/rules works: override_dh_auto_test: PYTHONPATH=. pytest-3 tests But it won't run the tests against the installed binaries.