Closed johnmacnamararseg closed 3 years ago
@abn, is there any love for this issue? This is currently blocking a number of projects.
Now (with poetry 1.2.0b1
and poetry-core 1.1.0a7
) it doesn't work in a different way.
For the following toml file (yes we want to generate a requirements.txt to install poetry together with some other tools):
[tool.poetry]
name = "test-resolver"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"
packages = [{include = "test_resolver"}]
[tool.poetry.dependencies]
python = "^3.7"
poetry = "1.2.0b1"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Important is the last line - zipp
. It's a direct dependency of importlib-metadata
specified as zipp = ">=0.5"
(no markers).
For the importlib-metadata
we have the following markers:
importlib-metadata = {version = ">=1.6.0", markers = "python_version < \"3.8\""} # poetry
importlib-metadata = {version = ">=1.7.0", markers = "python_version < \"3.8\""} # poetry-core
importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} # virtualenv
importlib-metadata = ">=3.6" # keyring
Importantly keyring
is an obligatory requirement of poetry
. keyring = ">=21.2.0"
.
It means that importlib-metadata
is an obligatory requirement. That's correct in the requirements.txt
.
importlib-metadata==4.11.3 ; python_version >= "3.7" and python_version < "3.8" or python_version >= "3.7" and python_version < "4.0"
And it means zipp
should also be installed as it's an obligatory requirement of the importlib-metadata
package. But it's not.
zipp==3.7.0 ; python_version >= "3.7" and python_version < "3.8"
For reference, stable poetry fails on importlib-metadata
level already so it's still some progress...
importlib-metadata==4.11.3; python_version >= "3.7" and python_version < "3.8" and (python_version >= "3.7" and python_full_version < "3.0.0" and python_version < "3.8" or python_version >= "3.7" and python_version < "3.8" and python_full_version >= "3.5.0")
With #5156 I get
zipp==3.7.0 ; python_version >= "3.7" and python_version < "3.8" or python_version >= "3.7" and python_version < "4.0"
which is a bit inelegant, but not wrong.
👍 That would be the expected output which while not perfect is easy to validate using the lock file.
And with python-poetry/poetry-core#308 for poetry-core (additionally to #5156) I get
zipp==3.7.0 ; python_version >= "3.7" and python_version < "4.0"
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.
-vvv
option).Issue
Issue present in 1.1.4 but not in 1.1.3. Chased it down to the rewrite done in PR #3237
Here is a simple (and real) pyproject.toml that will illustrate this issue
and the corresponding lockfile (with irrelevant deps removed)
running
poetry export
on that lockfile will show that the"platform_system == \"Windows\""
marker onpywin32
is not present inpoetry==1.1.4
More generally, issue seems to only occur under the following conditions:
Results in: