pip -d
tries (and fails) to download packages meant for wrong platform
#11418
Labels
type: bug
A confirmed bug or unintended behavior
Description
Hi,
I have a build system which uses
pip -d
to download packages along with their dependencies. Recently I ran into an error when I tried to update one of the packages I use (details below), which seems to stem frompip -d
trying to grab unnecessary dependencies (meant for a different platform).Some details:
I'm using Windows, and running
pip -d --platform manylinux1_x86_64
to download packages meant for Linux.I ran into the problem when I tried to switch from
azure-identity==1.3.1
toazure-identity==1.10.0
.azure-identity==1.10.0
depends, among other things, onmsal-extensions<2.0.0,>=0.3.0
which, in turn, depends onportalocker<3,>=1.6
for Windows-based platforms andportalocker<3,>=1.0
for non-Windows-based platforms.So far, so good.
However, all the versions of
portalocker
from1.6.0
seem to have a Windows-specific dependency on a Windows-specific package namedpywin32
(pywin32>=226; platform_system == "Windows"
). That in itself should not be a problem, butpip -d
seems to ignore the "windows-specificness" of this dependency and tries to download it - an operation which fails since there are, naturally, no versions of pywin32 meant for Linux.Expected behavior
I expect
pip -d --platform manylinux1_x86_64
to ignore Windows-specific dependencies.pip version
22.2.2
Python version
3.7.9
OS
Microsoft Windows 11 Enterprise Version 10.0.22000 Build 22000
How to Reproduce
pip
to22.2.2
.py -m pip download azure-identity==1.10.0 -d "C:\Temp\PipRepro" --platform "manylinux1_x86_64" --python-version "3.8" --only-binary=:all: --retries 3 --timeout 60
(you can substitute some other directory instead of
"C:\Temp\PipRepro"
, of course.pip
complains that it "Cannot install msal-extensions because these package versions have conflicting dependencies.".Output
Code of Conduct
The text was updated successfully, but these errors were encountered: