You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 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 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.
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.
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.
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?
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:
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.
Activity
abn commentedon 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 commentedon Oct 4, 2020
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 installusing 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 anotherpoetry install, wheel is installed.I simply haven't investigated converting from
setup.pyyet, 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.Recover from an issue with Poetry 1.1.0
abn commentedon Oct 4, 2020
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 usevirtualenvto create the environment, this will installpip,setuptoolsandwheel. Droppingwheelfrompyproject.tomland regenerating the lock file, and also the enviornment should fix your issue. Wheel should be available in the environments created by1.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.
Wheel dependency does not export
brechtm commentedon Oct 5, 2020
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 commentedon Oct 19, 2020
I think that what led to the:
Removing wheel (0.34.2)line was that thepoetry.lockfile was generated using a old version of poetry. The version ofpoetryin the CI was probably the latest version of poetry, in which thewheelpackage 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,setuptoolsandwheels, 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 commentedon Oct 20, 2020
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:
poetry installusing 1.1.xpoetry updatepoetry installagainpmantica1 commentedon Oct 20, 2020
Yep you are right. It's probably not worth fixing this.
laggardkernel commentedon Jul 1, 2021
Update: seems my problem is unrelated, I'd better switch to
psycopg2-binary.psycopg2depends onwheelto avoid building the package from source.wheeldoes exist inpoetry.lockandpyproject.toml. But during creating the environment,piptells mewheelis not installed.Why does
poetrykeep removingwheeleven it's defined inpoetry.lockandpyproject.toml?Now I'm not able to build the virtual environment.
abn commentedon May 12, 2022
This should not happen with 1.2.
github-actions commentedon 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.