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 export generates wrong source flags #219

Open
4 tasks done
simonrouse9461 opened this issue Jul 7, 2023 · 1 comment
Open
4 tasks done

poetry export generates wrong source flags #219

simonrouse9461 opened this issue Jul 7, 2023 · 1 comment

Comments

@simonrouse9461
Copy link

simonrouse9461 commented Jul 7, 2023

  • 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"
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) 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 Secrus transferred this issue from python-poetry/poetry Jul 7, 2023
@mil-ad
Copy link

mil-ad commented Mar 14, 2024

@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" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants