Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
uniquify paths in PYTHONPATH #1709
When running in a complex environment with lots of installed
I don't expect this to be accepted. Just letting you know there's a problem here and how to fix it.
After some investigation, I can see that the bug lies here, where setuptools is attempting to make sure that every package that was just installed has its path on PYTHONPATH, so that any subprocess invocation also has those packages available for import.
The fact that all of these paths are the same, however, is a little surprising. These paths would be installed by
Since this code is part of the pending-deprecated test command, I'm going to save trouble investigating the root cause and simply adopt a technique similar to the one you've proposed here.
Apr 5, 2019
Thanks @jaraco for taking a look at this.
This seems like this approach would be problematic in complex installations, like ours. Why is this necessary?
That’s just how easy_install works. Each package is meant to be an encapsulated egg, such that uninstallation is simply an rm operation (similar to how macOS installs Applications). To make those packages live on the python path, easy_install would have a .pth file to add these paths... but for these on-demand test dependencies, another technique was needed.
I think one motivation for moving away from easy_install was to avoid the essential performance hit of each package having its own path.