Update pip to defined versions after creating a new venv [feature]#1971
Closed
tsvikas wants to merge 2 commits into
Closed
Update pip to defined versions after creating a new venv [feature]#1971tsvikas wants to merge 2 commits into
tsvikas wants to merge 2 commits into
Conversation
added 2 commits
February 3, 2020 18:46
Until now, a new venv created with poetry would have an undefined pip version. This could be problematic, as older pip versions are not compatible with some packages (see issues list below), and might have security risks. And on the other hand, future pip versions might introduce API changes that will prevent poetry from working. This commit forces new venvs to update pip to a defined range of versions. Updating pip just after venv creation (and not each time before package installation) will still allow users to manualy change it, if the need arise. code is loosely based on #740 closes: #732 #1661 #1962 #1651
in windows, run() forces shell=True, which understand the < and > in the requirements as cmd operators. To prevent that, we encase the requirement in quotes, but this requires us to use shell=True in linux also.
3 tasks
Contributor
|
Hi, I've also run into this issue, when It would be nice if poetry would update |
Member
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Until now, a new venv created with poetry would have an undefined pip version (for example, in my setup it's pip 18.1). This could be problematic, as older pip versions are not compatible with some packages (manylinux2010/2014 packages - for example, tensorflow 2), and might have security risks. On the other hand, future pip versions might introduce API changes that will prevent poetry from working.
This code forces new venvs to update their pip to a version from a defined range of versions. Updating pip happens just after the venv creation (and not each time before package installation). This will allow users to manually change it if the need arises.
Code is loosely based on #740
I know that the need for internet connectivity in venv creation might be an issue, but I was not sure how to tackle it, and I wanted to get feedback on this code first.
Closes:
closes #732 (partially - this PR does not install setuptools)
closes #1661
closes #1962
closes #1651
Pull Request Check List
Tests were passing in my setup, but might need tweaking to pass with different setups (i.e. python 3.4)
No relevant documentation found, but I did my best to add relevant comments.
Should I update the changelog?