question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

poetry should upgrade pip and setuptools in virtualenvs it creates

See original GitHub issue
  • 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:

python3.6 `which poetry` shell
pip install -U pip

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:17
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

16reactions
kawing-chiucommented, Feb 21, 2020

I have an idea: maybe pip’s version should be put into pyproject.toml, just like python’s version:

[tool.poetry.dependencies]  
python = "^3.8"
pip = "^19.2"

It can be special-cased so that poetry update will not update it, just like python, unless poetry update pip is called. Initially, poetry can specify a version (range) that it thinks is safe for it.

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 pyproject.toml, it looks like:

[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.

16reactions
dbantycommented, Nov 29, 2019

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 poetry run pip install --upgrade pip

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get python-poetry to detect a version of pip within a ...
I'm playing around with a fork of isort, using this installation guide but including a virtualenv —though a platform install fails as well ......
Read more >
Poetry and Outdated Pip and Setuptools - PS, codes.
After creating an environment, running $ poetry run python -m pip install --upgrade setuptools pip would always yield output such as this:
Read more >
Upgrade Your Python Project With Poetry | The NTC Mag
Poetry will automatically install all the dependencies with poetry install (this replaces for pip install -r requirements.txt , python ...
Read more >
Announcing Poetry 1.2.0 | Blog
Poetry 1.2 will properly lock and manipulate the versions of setuptools, pip, and wheel in the target environment. This is to support projects ......
Read more >
Project Summaries - Python Packaging User Guide
Pipenv is a project that aims to bring the best of all packaging worlds to the Python world. It harnesses Pipfile, pip, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found