python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.72k stars 2.27k forks source link

Consider upgrading to latest pip to properly install manylinux2014 wheels #2146

Closed playpauseandstop closed 4 years ago

playpauseandstop commented 4 years ago

Issue

Internally Poetry still using pip==19.2.3. While in most cases it doesn't result in any issues, installing pyheif==0.4 (and other projects with manylinux2014 wheels) may result in error.

Steps to reproduce

Easiest way to reproduce is to attempt installing pyheif within Docker python:3.8.2-slim-buster or derivates images with poetry (which internally used pip 19.2.3) & pip 20.0.2,

  1. docker build -t Dockerfile.poetry & docker build -f Dockerfile.pip19 will fail
  2. While docker build -t Dockerfile.pip20 will succeed

That shows, that latest pip properly install manylinux2014 wheels, while poetry & pip==19.2.3 do not.

Depending on latest pip

Adding latest pip to pyproject.toml dependencies as,

poetry add pip==20.0.2

do not fix the issue and the manylinux2014 wheels still not installable with poetry.

Fix the issue with pyheif

To fix the issue with pyheif I need to install latest libheif-dev package from sid as,

RUN echo "deb http://ftp.de.debian.org/debian sid main" > /etc/apt/sources.list.d/sid.list
RUN apt update
RUN apt install -y libheif-dev

Related: https://github.com/python-poetry/poetry/issues/1651#issuecomment-589463781

WouldYouKindly commented 4 years ago

Poetry cannot install the latest versions of yarl and multidict, which breaks installation of aiohttp in our CI environment. Both libraries now build only manylinux2014 wheels.

sinoroc commented 4 years ago

Poetry cannot install the latest versions of yarl and multidict, which breaks installation of aiohttp in our CI environment. Both libraries now build only manylinux2014 wheels.

@WouldYouKindly You might want to open a new ticket. I am not sure your issue is related to the original ticket.

As far as I know poetry does not depend much on pip directly anymore. Since v1.1, poetry has its own installer, so I have my doubts that the original ticket is still relevant. Although it still uses pip on some particular cases, if I am not mistaken.

Anyway, I could not recreate your issue poetry add yarl completed successfully on my machine.

I would advise you to open a new ticket and provide the exact details of your issue (version numbers, full pyproject.toml, full console output, etc.).

abn commented 4 years ago

As @sinoroc suggested, I do not think this should be an issue anymore considering that #2666 has been merged. As we are now tied to the version provided by virtualenv when creating the environment. See below for tests verifying this is not an issue.

If further control is required over the pip version, recommendation is to pre-create the virtualenvironment for the project as required. You can also get poetry to upgrade the pip version in the active environment by using poetry run pip install --upgrade pip.

podman run --rm -i --entrypoint bash python:3.8 <<EOF
set -xe
python -m pip install -q poetry
poetry new foobar
pushd foobar
sed -i /pytest/d pyproject.toml
poetry run pip --version
poetry add pyheif==0.4
EOF
+ python -m pip install -q poetry
+ poetry new foobar
Created package foobar in foobar
+ pushd foobar
/foobar /
+ sed -i /pytest/d pyproject.toml
+ poetry run pip --version
Creating virtualenv foobar-lWDpn5M1-py3.8 in /root/.cache/pypoetry/virtualenvs
pip 20.2.4 from /root/.cache/pypoetry/virtualenvs/foobar-lWDpn5M1-py3.8/lib/python3.8/site-packages/pip (python 3.8)
+ poetry add pyheif==0.4

Updating dependencies
Resolving dependencies...

Writing lock file

Package operations: 3 installs, 0 updates, 0 removals

  • Installing pycparser (2.20)
  • Installing cffi (1.14.3)
  • Installing pyheif (0.4)
abn commented 4 years ago

PS: @playpauseandstop thank you for a great issue report! :tada:

github-actions[bot] commented 8 months ago

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.