-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Use python from virtualenv's bin directory when executing commands #5107
Use python from virtualenv's bin directory when executing commands #5107
Conversation
We are executing python commands like `python /path/to/bin/command` Sometimes it gives a non-deterministic behaviour. Like using pip from the virtualenv in the first build and using pip from the global installation other times. Commands like sphinx-build and mkdocs have an `console_scripts` entry point and shouldn't be a problem.
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.
Makes sense. Weird that this is an issue, but nothing really surprises me with virtualenv path hacking.
(We can ship this with the deploy today after the tests are 👍) |
Oh boy! This is crazy! Nice that you find this issue. It's a good one to be bitten off 😢 |
There are some cases were rtd uses the old installed version of mkdocs instead of the one installed by the user, like in readthedocs#5532 (comment) Which gives an error because it's using a yaml file supported only in new mkdocs versions. This is similar to readthedocs#5107
There are some cases were rtd uses the old installed version of mkdocs instead of the one installed by the user, like in readthedocs#5532 (comment) Which gives an error because it's using a yaml file supported only in new mkdocs versions. This is similar to readthedocs#5107
We are executing python commands like
python /path/to/bin/command
Sometimes it gives a non-deterministic behaviour.
Like using pip from the virtualenv in the first build
and using pip from the global installation other times.
Commands like sphinx-build and mkdocs have an
console_scripts
entrypoint and shouldn't be a problem.
Now we are running the commands like
/path/to/bin/virtualenv/python -m pip install ...
, which gives a deterministic behaviour in every build.I notice this problem while implementing #5006.
When calling the
pyhton /path/to/pip list
command it gives an error (pypa/pip#5373), and when calling/path/to/pip list
it lists only the local packages, and in the second build/path/to/pip list
list only the global packages. With this fix,/path/to/python -m pip list
list global and local packages (in every build) as the docs say.I'm not sure about conda, but I think we have a command that uses pip there. But first I'd like to have some opinions here. And maybe someone using rtd without docker can test this to make sure this doesn't break that workflow.