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

when supplying multiple url with non intersecting markers, poetry downloads all of them #7176

Closed
chanansh opened this issue Dec 11, 2022 · 2 comments
Labels
kind/question User questions (candidates for conversion to discussion)

Comments

@chanansh
Copy link

chanansh commented Dec 11, 2022

Issue

I have used markers to support torch installation on different platforms:

torch = [
{markers = "sys_platform == 'macos'", url = "https://download.pytorch.org/whl/cpu/torch-1.13.0-cp310-none-macosx_11_0_arm64.whl"},
{markers = "sys_platform == 'linux' and platform_machine == 'arm64'", url="https://download.pytorch.org/whl/torch-1.13.0-cp310-cp310-manylinux2014_aarch64.whl"},
{markers = "sys_platform == 'linux' and platform_machine == 'x86_64'", url="https://download.pytorch.org/whl/cpu/torch-1.13.0%2Bcpu-cp310-cp310-linux_x86_64.whl"}]

However, when I do poetry install what happens is that all of them get downloaded, albeit only one of them is actually used. It seems like the condition logic is run only AFTER the downloads.

[urllib3.connectionpool] Starting new HTTPS connection (1): download.pytorch.org:443
[urllib3.connectionpool] https://download.pytorch.org:443 "GET /whl/cpu/torch-1.13.0-cp310-none-macosx_11_0_arm64.whl HTTP/1.1" 200 55694260
[urllib3.connectionpool] Starting new HTTPS connection (1): download.pytorch.org:443
[urllib3.connectionpool] https://download.pytorch.org:443 "GET /whl/torch-1.13.0-cp310-cp310-manylinux2014_aarch64.whl HTTP/1.1" 200 73237944
[urllib3.connectionpool] Starting new HTTPS connection (1): download.pytorch.org:443
[urllib3.connectionpool] https://download.pytorch.org:443 "GET /whl/cpu/torch-1.13.0%2Bcpu-cp310-cp310-linux_x86_64.whl HTTP/1.1" 200 198532501

Finally it installs only the correct one:

• Installing torch (1.13.0+cpu https://download.pytorch.org/whl/cpu/torch-1.13.0%2Bcpu-cp310-cp310-linux_x86_64.whl): Installing...

@chanansh chanansh added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Dec 11, 2022
@neersighted
Copy link
Member

Not a bug; this is by design. Poetry must gather all URLs in order to lock them (see #7121 for a recent change where we save the hash).

Note that the wheels will be fetched any time locking is performed, see #2415.

@neersighted neersighted added kind/question User questions (candidates for conversion to discussion) and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Dec 11, 2022
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/question User questions (candidates for conversion to discussion)
Projects
None yet
Development

No branches or pull requests

2 participants