python-poetry / python-poetry/poetry-plugin-export
Incorrect dependency resolution when specifying same package multiple times with different local version labels
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 335
- Forks
- 57
- Avg merge
- 1h 23m
- Merged PRs (30d)
- 3
Description
I've configured markers in the pyproject.toml file to install TensorFlow with the Nvidia local version label exclusively when on the aarch64 architecture. However, when exporting to requirements.txt, only the Nvidia local version label is considered, resulting in the undesired installation of 2.12.0+nv23.06 on x86_64 platforms. As a workaround, setting PyPi tensorflow to a different base version (2.12.1) causes export to work as expected.
A minimal pyproject.toml
[tool.poetry]
name = "tensor"
version = "0.1.0"
description = ""
authors = []
[tool.poetry.dependencies]
python = "~3.11"
tensorflow = [
{ version = "2.12.0+nv23.06", markers = "platform_machine=='aarch64'", source = "Nvidia" },
{ version = "2.12.0", markers = "platform_machine=='x86_64'", source = "PyPI" }
]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[[tool.poetry.source]]
name = "PyPI"
priority = "primary"
[[tool.poetry.source]]
# Source for special Jetson Tensorflow.
# The numbers on the end of the URL should match the Jetpack version.
name = "Nvidia"
url = "https://developer.download.nvidia.com/compute/redist/jp/v512"
priority = "explicit"
Exporting
> poetry export --without-hashes -vvv
Loading configuration file /home/me/.config/pypoetry/config.toml
Adding repository PyPI (https://pypi.org/simple/) and setting it as primary
Adding repository Nvidia (https://developer.download.nvidia.com/compute/redist/jp/v512) and setting it as explicit
Source (poetry-lockfile): 1 packages found for tensorflow 2.12.0+nv23.06
Source (poetry-lockfile): 2 packages found for tensorflow 2.12.0
--extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v512
absl-py==2.1.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
astunparse==1.6.3 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
cachetools==5.3.2 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
certifi==2023.11.17 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
charset-normalizer==3.3.2 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
flatbuffers==23.5.26 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
gast==0.4.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
google-auth-oauthlib==1.0.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
google-auth==2.26.2 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
google-pasta==0.2.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
grpcio==1.60.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
h5py==3.10.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
idna==3.6 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
jax==0.4.23 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
keras==2.12.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
libclang==16.0.6 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
markdown==3.5.2 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
markupsafe==2.1.4 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
ml-dtypes==0.3.2 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
numpy==1.23.5 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
oauthlib==3.2.2 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
opt-einsum==3.3.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
packaging==23.2 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
protobuf==4.25.2 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
pyasn1-modules==0.3.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
pyasn1==0.5.1 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
requests-oauthlib==1.3.1 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
requests==2.31.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
rsa==4.9 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
scipy==1.12.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
setuptools==69.0.3 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
six==1.16.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
tensorboard-data-server==0.7.2 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
tensorboard==2.12.3 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
tensorflow-estimator==2.12.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
tensorflow-io-gcs-filesystem==0.35.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
tensorflow==2.12.0+nv23.06 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
termcolor==2.4.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
typing-extensions==4.9.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
urllib3==2.1.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
werkzeug==3.0.1 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
wheel==0.42.0 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
wrapt==1.14.1 ; python_version >= "3.11" and python_version < "3.12" and (platform_machine == "aarch64" or platform_machine == "x86_64")
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the minimal pyproject.toml and the poetry export --without-hashes -vvv command shown. Start by tracing how export handles the two tensorflow entries with different local versions and markers; done means the generated requirements.txt keeps the platform-specific versions and does not select the Nvidia version on x86_64.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100