-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
poetry should upgrade pip and setuptools in virtualenvs it creates #1651
Comments
I think the default behavior is appropriate, pip has been known to make changes that break Poetry, so auto-updating seems dangerous. This is probably more of a feature request for maybe a config setting to auto-update? As a very slightly easier command you can do |
I somewhat agree on the "may break stuff", but the version of pip that ships with, for example, Python 3.6 is dangerously old. The pip maintainers want everyone to be on the latest and greatest, for some very good reasons. I really don't think the default should be to use the ancient pip that likely comes with your python distribution. |
Just got bitten by this again today,
Quickly tiring of this whackamole, I eventually remembered that the venv poetry creates on the Python I'm using (3.6) will have the crazy old versions of pip and setuptools in them which needed upgrading:
I appreciate that the fail here is on the part of Python itself (shipping with ancient versions of those libraries with no way to upgrade them...) but it's pretty frustrating to have to remember to do |
I have an idea: maybe pip's version should be put into [tool.poetry.dependencies]
python = "^3.8"
pip = "^19.2" It can be special-cased so that Here is another example why this is useful: The latest PyQt5 release 5.14.1 switches to the manylinux2014 platform tag, so it's wheel can only be handled by a very recent pip (only pip versions >= 19.3 recognize this platform tag). If pip's version can be put into [tool.poetry.dependencies]
python = "^3.8"
pip = "^19.3"
pyqt5 = "^5.14" Then there is no need for any manual upgrade of pip when the project is installed. |
@kawing-chiu Note that pip switched to calendar-based versioning in 2018, so version ranges cannot be set using semantic operators, such as |
@absassi Hi. I'm not sure I understand your point. Currently poetry just ignores the pip entry if you try to put one into |
@kawing-chiu my point is that |
Just ran into this myself. When I finally discovered this was the root cause of my problem, I got it working with E.g. someone else suggested adding the feature as an option, like: Note: I also tried |
poetry now uses |
@finswimmer as of which version? 1.1.4 still yields |
As far as I understood poetry does not intervene here. It is virtualenv (a dependency of poetry) that takes care of installing pip and setuptools in the virtual environments. virtualenv has its own schedule and rules to decide when to update its internal copies of pip and setuptools that will be used for subsequent creations of virtual environments. It is described in virtualenv's user guide. Running This could probably be a FAQ. Or maybe this could be moved to a Q&A discussion. |
@sinoroc I tried your solution as it seems the most clean way to proceed, but new virtualenvs from poetry are still created with an old pip version. |
What is your poetry version? |
@sinoroc I had indeed an old version. After updating to version 1.1.4 and using your solution, it is all working well! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
OS version and name: RHEL7.5
Poetry version: Poetry version 1.0.3
Issue
Poetry does not appear to upgrade the version of pip that appears in virtualenvs it creates and manages. This means that, in my case, I get an ancient pip 10.x that doesn't know to use binary wheels, causing installs of packages to fail as I don't have python-devel on the machines I deploy to.
When poetry creates a virtualenv, it should, as part of that process, upgrade pip to the latest version available, and continue to upgrade every time it's about to do anything that installs or removes packages from a virtualenv.
The workaround for me is:
The text was updated successfully, but these errors were encountered: