Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 801658

Summary: distutils-r1.eclass should export PYTHONPATH
Product: Gentoo Linux Reporter: Florian Schmaus <flow>
Component: EclassesAssignee: Python Gentoo Team <python>
Status: RESOLVED INVALID    
Severity: normal CC: mgorny, sam
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/21576
https://bugs.gentoo.org/show_bug.cgi?id=927549
Whiteboard:
Package list:
Runtime testing required: ---

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.