Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 801658 - distutils-r1.eclass should export PYTHONPATH
Summary: distutils-r1.eclass should export PYTHONPATH
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-07-12 07:17 UTC by Florian Schmaus
Modified: 2024-03-22 18:10 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Schmaus gentoo-dev 2021-07-12 07:17:48 UTC
While working on src_test for x11-wm/herbstluftwm I found that I had to export PYTHONPATH before pytest invoked in python_test() would pick the path up.

I am not sure why this appears to be the first ebuild where, after calling distutils_install_for_testing(), PYTHONPATH had to be exported. I can only speculate that this is maybe because PYTHONPATH was already exported somehow when distutils_install_for_testing() was invoked.

Reproducible: Always
Comment 1 Larry the Git Cow gentoo-dev 2021-07-12 07:25:52 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fa0ed9fd7fb3abbd6b2fd5f7f6b6ec638742bf7

commit 1fa0ed9fd7fb3abbd6b2fd5f7f6b6ec638742bf7
Author:     Florian Schmaus <flow@gentoo.org>
AuthorDate: 2021-07-12 07:24:53 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: 2021-07-12 07:24:53 +0000

    x11-wm/herbstluftwm: use distutils_install_for_testing in src_test
    
    Bug: https://bugs.gentoo.org/801658
    Signed-off-by: Florian Schmaus <flow@gentoo.org>

 x11-wm/herbstluftwm/herbstluftwm-0.9.3.ebuild | 7 +++++++
 x11-wm/herbstluftwm/herbstluftwm-9999.ebuild  | 7 +++++++
 2 files changed, 14 insertions(+)
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-07-12 07:38:13 UTC
Didn't you get my reply on IRC?  You can't expect Python to work unless you're in Python environment that's run via python_foreach_impl or python_setup.  In this case, you need to call distutils-r1_src_test from your src_test, and do all the logic inside python_test.