Skip to content
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 won't install 'wheel' package (1.0.10 -> 1.1.0 regression) #3075

Closed
2 tasks done
brechtm opened this issue Oct 4, 2020 · 10 comments
Closed
2 tasks done

Poetry won't install 'wheel' package (1.0.10 -> 1.1.0 regression) #3075

brechtm opened this issue Oct 4, 2020 · 10 comments
Labels
kind/bug Something isn't working as expected

Comments

@brechtm
Copy link

brechtm commented Oct 4, 2020

  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • (N/A) If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: Linux, MacOS, Windows

  • Poetry version: 1.1.0

  • Link to your pyproject.toml file: brechtm/rinohtype/pyproject.toml

Issue

Since updating to 1.1.0, Poetry will no longer install the wheel dependency. See the "Install development dependencies" section of any "unit tests (wheel)" jobs on rinohtype's CI tests. After creating a new virtual environment, instead of installing wheel, Poetry prints:

 • Removing wheel (0.34.2)

I can reproduce this locally. Removing and adding 'wheel' manually does not help.

@brechtm brechtm added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 4, 2020
@abn
Copy link
Member

abn commented Oct 4, 2020

@brechtm this was an intentional change introduced via b92e681 since it is currently a base package in virtual environments. The removal seems to happen because it is removed from the lock, since it is now an unsafe package. I need to check if we can make it safe without impacting anything.

The CI jobs you pointed to indicate the use of poetry run python setup.py bdist_wheel. I am also a bit confused as to why the project uses both setuptools and poetry together. If you drop by the discord sover, I'd like to know more about your use case.

@brechtm
Copy link
Author

brechtm commented Oct 4, 2020

@brechtm this was an intentional change introduced via b92e681 since it is currently a base package in virtual environments.

What does it mean that wheel is a base package in virtual environments? That sounds like it is always available, without the need to install it. However, after a poetry install using 1.1.0, wheel is not installed in the venv (poetry run pip list | grep wheel).

After a poetry update (updates virtualenv and tqdm), wheel is still not installed. Only after deleting the venv and another poetry install, wheel is installed.

The CI jobs you pointed to indicate the use of poetry run python setup.py bdist_wheel. I am also a bit confused as to why the project uses both setuptools and poetry together. If you drop by the discord sover, I'd like to know more about your use case.

I simply haven't investigated converting from setup.py yet, because it includes custom code to determine the version number from git. I'm sure this is over-complicating things, but that is how it is at the moment. I now use Poetry just to set up the development venv.

brechtm added a commit to brechtm/rinohtype that referenced this issue Oct 4, 2020
@abn
Copy link
Member

abn commented Oct 4, 2020

Only after deleting the venv and another poetry install, wheel is installed.

That is what I would expect if you were using a cached venv created prior to 1.1.0. The change in #2666 means that now we use virtualenv to create the environment, this will install pip, setuptools and wheel. Dropping wheel from pyproject.toml and regenerating the lock file, and also the enviornment should fix your issue. Wheel should be available in the environments created by 1.1.0.

I will take a look to see if we "really" need wheel to be marked unsafe. But I suspect we will since otherwhise wheel building for sdist dependencies might fail today in certain scenarios.

glenjarvis added a commit to glenjarvis/github-commit-status that referenced this issue Oct 5, 2020
@brechtm
Copy link
Author

brechtm commented Oct 5, 2020

That is what I would expect if you were using a cached venv created prior to 1.1.0.

Note that the issue was not fixed by deleting the venv and then doing a poetry install. In the CI jobs I referenced above the cached venv was not restored (because poetry.lock was changed), so these were also fresh installs.

@pmantica1
Copy link

pmantica1 commented Oct 19, 2020

I think that what led to the:Removing wheel (0.34.2) line was that the poetry.lock file was generated using a old version of poetry. The version of poetry in the CI was probably the latest version of poetry, in which the wheel package was unsafe. Since this package is marked as unsafe in the latest version of poetry, the poetry in the CI decided to remove it. However, I think that most if not all of the unsafe packages, e.g. pip, setuptools and wheels, are by default included in a python virtualenv. (See link below). So arguably the right behavior for poetry here would be to remove these packages from the poetry.lock file without uninstalling them. Thoughts?

https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments

@brechtm
Copy link
Author

brechtm commented Oct 20, 2020

So arguably the right behavior for poetry here would be to remove these packages from the poetry.lock file without uninstalling them. Thoughts?

For what it's worth, I don't think a fix for this should be high priority as it will only occur in a very specific situation. The problem can be manually fixed without too much fuss and there are probably more urgent issues to address.

For anyone running into the same problem, this should fix it:

  • delete your virtual environment
  • poetry install using 1.1.x
  • poetry update
  • delete the new virtual environment
  • poetry install again

@pmantica1
Copy link

Yep you are right. It's probably not worth fixing this.

@laggardkernel
Copy link

laggardkernel commented Jul 1, 2021

Update: seems my problem is unrelated, I'd better switch to psycopg2-binary.


psycopg2 depends on wheel to avoid building the package from source. wheel does exist in poetry.lock and pyproject.toml. But during creating the environment, pip tells me wheel is not installed.

Package operations: 82 installs, 0 updates, 1 removal, 2 skipped

  • Removing wheel (0.34.2)
...
  • Installing psycopg2 (2.8.5): Failed

  EnvCommandError

  Command ['/Users/username/.local/share/pyenv/versions/search-spider-tC2SZ2ft-py3.7/bin/pip', 'install', '--no-deps', '/Users/username/Library/Caches/pypoetry/artifacts/43/1e/47/e00cc30663ca574d30900f282f4d8dbde97c45de8357536fbef7589179/psycopg2-2.8.5.tar.gz'] errored with the following return code 1, and output:
  Processing /Users/username/Library/Caches/pypoetry/artifacts/43/1e/47/e00cc30663ca574d30900f282f4d8dbde97c45de8357536fbef7589179/psycopg2-2.8.5.tar.gz
  Using legacy 'setup.py install' for psycopg2, since package 'wheel' is not installed.
  Installing collected packages: psycopg2
      Running setup.py install for psycopg2: started
      Running setup.py install for psycopg2: finished with status 'error'
      ERROR: Command errored out with exit status 1:

Why does poetry keep removing wheel even it's defined in poetry.lock and pyproject.toml?

Now I'm not able to build the virtual environment.

@abn
Copy link
Member

abn commented May 12, 2022

This should not happen with 1.2.

$ poetry remove wheel
Updating dependencies
Resolving dependencies... (0.1s)

Writing lock file

Package operations: 0 installs, 0 updates, 1 removal

  • Removing wheel (0.37.1)
$ poetry add wheel
Using version ^0.37.1 for wheel

Updating dependencies
Resolving dependencies... (0.1s)

Writing lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing wheel (0.37.1)

@abn abn closed this as completed May 12, 2022
@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Jun 11, 2022
Copy link

github-actions bot commented Mar 1, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

5 participants