Update pip to defined versions after creating a new venv [feature] #1971
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?