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

pip download with --platform specified fails to resolve dependencies with sys_platform== conditional #12466

Closed
1 task done
tim-stephenson opened this issue Jan 9, 2024 · 4 comments
Labels
resolution: duplicate Duplicate of an existing issue/PR type: bug A confirmed bug or unintended behavior

Comments

@tim-stephenson
Copy link

Description

When calling pip download --only-binary ":all:" with a platform specifier (--platform), it does not properly follow sys_platform specifiers defined in the dependencies.
The example I am trying to download jupyter_core with dependencies specified in the pyproject.toml as follows:

dependencies = [
  "platformdirs>=2.5",
  "traitlets>=5.3",
  "pywin32>=300 ; sys_platform == 'win32' and platform_python_implementation != 'PyPy'"
]

In this situation pip uses my own platform instead of the one specified with the --platform specifier

Expected behavior

Should download required whl files for jupyter_core

pip version

23.3.2

Python version

3.10

OS

Windows 10

How to Reproduce

pip download "jupyter-core==5.7.1" --only-binary ":all:" --python-version 310 --platform manylinux_2_17_x86_64 --platform manylinux_2_12_x86_64 --platform manylinux_2_5_x86_64

Output

ERROR: Could not find a version that satisfies the requirement pywin32>=300; sys_platform == "win32" and platform_python_implementation != "PyPy" (from jupyter-core) (from versions: none)
ERROR: No matching distribution found for pywin32>=300; sys_platform == "win32" and platform_python_implementation != "PyPy"

Code of Conduct

@tim-stephenson tim-stephenson added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jan 9, 2024
@tim-stephenson
Copy link
Author

Using cpython for reference.

@ethanwhite
Copy link

I ran into this same issue with our package for helping teach Python in internet-limited locations. We create partial PyPI mirrors on local teaching servers using pypi-mirror, but when running on Windows we can't create the mirrors for non-Windows platforms.

carpentriesoffline/offlinedatasci#95

I'm willing to consider making a PR if someone with some experience thinks its relatively doable for a first time contributor and can point me in the right direction. Alternatively if anyone has thoughts on a work around I'd appreciate it.

@ethanwhite
Copy link

This is covered by #11664 so can probably be closed. Would be great to get a resolution to #11664.

@ichard26 ichard26 added the resolution: duplicate Duplicate of an existing issue/PR label Jun 23, 2024
@ichard26
Copy link
Member

Closing as a duplicate, indeed! Thanks.

@ichard26 ichard26 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 23, 2024
@ichard26 ichard26 removed the S: needs triage Issues/PRs that need to be triaged label Jun 23, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: duplicate Duplicate of an existing issue/PR type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants