poetry-plugin-export
poetry-plugin-export copied to clipboard
`poetry export` generates wrong source flags
- Poetry version: 1.5.1
- Python version: 3.10
- OS version and name: Ubuntu 20.04.6
- pyproject.toml:
[tool.poetry]
name = "mypkg"
version = "0.1.0"
description = ""
authors = [""]
readme = "README.md"
packages = []
[tool.poetry.dependencies]
python = "~3.10"
torch-scatter = { version = "2.1.1", source = "pyg-cuda" }
torch-sparse = { version = "0.6.17", source = "pyg-cuda" }
[[tool.poetry.source]]
name = "PyPI"
priority = "primary"
[[tool.poetry.source]]
name = "pyg-cuda"
url = "https://data.pyg.org/whl/torch-2.0.0+cu118.html"
priority = "primary"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
- [x] I am on the latest stable Poetry version, installed using a recommended method.
- [x] I have searched the issues of this repo and believe that this is not a duplicate.
- [x] I have consulted the FAQ and blog for any relevant entries or release notes.
- [x] If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption) and have included the output below.
Issue
The poetry export command can not distinguish between --extra-index-url and --find-links as their source definitions are the same.
To be specific, when I run poetry export --without-hashes > requirements.txt, this is what it generates:
--extra-index-url https://data.pyg.org/whl/torch-2.0.0+cu118.html
numpy==1.25.0 ; python_version >= "3.10" and python_version < "3.11"
scipy==1.11.1 ; python_version >= "3.10" and python_version < "3.11"
torch-scatter==2.1.1+pt20cu118 ; python_version >= "3.10" and python_version < "3.11"
torch-sparse==0.6.17+pt20cu118 ; python_version >= "3.10" and python_version < "3.11"
Then, pip install -r requirements.txt gives the following error:
ERROR: Could not find a version that satisfies the requirement torch-scatter==2.1.1+pt20cu118 (from versions: 0.3.0, 1.0.2, 1.0.3, 1.0.4, 1.1.0, 1.1.1, 1.1.2, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.4.0, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.1.0, 2.1.1)
ERROR: No matching distribution found for torch-scatter==2.1.1+pt20cu118
This is because the https://data.pyg.org/whl/torch-2.0.0+cu118.html is supposed to be a --find-links url rather than --extra-index-url or --index-url. Apparently, poetry does not tell the difference due to their same definition.
@Secrus Are there any plans to fix this any time soon? It breaks libtpu-nightly package which needs something like:
[[tool.poetry.source]]
name = "libtpu_releases"
url = "https://storage.googleapis.com/jax-releases/libtpu_releases.html"
libtpu-nightly = { version="0.1.dev20231102", source="libtpu_releases" }