-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print a warning when mixing $EBPYTHONPREFIXES
and $PYTHONPATH
modules
#3521
base: 5.0.x
Are you sure you want to change the base?
Conversation
2777a95
to
2323b76
Compare
$EBPYTHONPREFIXES
and $PYTHONPATH
modules
conflicts = [dep['name'] for dep in self.cfg.dependencies() if is_in_pythonpaths(dep)] | ||
if conflicts: | ||
print_warning('The following modules set $PYTHONPATH but $%s is also used: %s\n' | ||
'Mixing such modules might cause unexpected results during the build of Python packages. ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use problems
instead of results
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to be more generic because the result may not be a problem but still not what is expected or even intended
Looks OK to me at first glance, but I would like @Micket to pitch in here too... |
ping @Micket |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine to me, i'll upload a test report
Hm, i wanted to test this in conjunction with --prefer-python-search-path, it would help me if this targeted 5.0.x instead for testing. |
$PYTHONPATH takes precedence which might lead to unexpected or wrong packages being used especially when a dependency includes a newer package than another dependency. As it is very hard to find this as the cause print a warning when this situation is found.
2323b76
to
df5a827
Compare
Rebased and retargeted to 5.0x |
$PYTHONPATH takes precedence which might lead to unexpected or wrong packages being used especially when a dependency includes a newer package than another dependency.
As it is very hard to find this as the cause print a warning when this situation is found.
I ran into this while building
scipy
of theSciPy-bundle
which includes patches that require a newerCython
as the build dependency then what is available in thePython-bundle-PyPI
module. As only Python-bundle used$PYTHONPATH
the package from theCython
module was ignored even thoughwhich cython
points to the right binary.The error wasn't helpful:
The least we can do is to detect such issues and warn the user.
The check is triggered for direct dependencies when both
$PYTHONPATH
and$EBPYTHONPREFIXES
are set and the Python module is loaded.I only check for modules that have a
lib/python*/site-packages
folder and specifically exclude the Python module which sets$PYTHONPATH
for thesite-customize.py
This should catch most false positives while still catching enough real issues