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 install *.whl fails on Windows #10808

Closed
1 task done
peterjc opened this issue Jan 19, 2022 · 5 comments
Closed
1 task done

pip install *.whl fails on Windows #10808

peterjc opened this issue Jan 19, 2022 · 5 comments
Labels
resolution: not a bug Determined as not a bug in pip

Comments

@peterjc
Copy link

peterjc commented Jan 19, 2022

Description

On Linux and macOS I have scripted a build process which makes a wheel, and then (usually in in a clean environment) installs the wheel. The wheel filename depends on the version etc, and by construction there is only one wheel present.

This works on Linux and macOS:

$ cd dist
$ ls *.whl  # confirm exactly one wheel present
$ pip install *.whl

The equivalent fails on Windows:

> cd dist
> dir *.whl
> pip install *.whl
WARNING: Requirement '*.whl' looks like a filename, but the file does not exist
ERROR: *.whl is not a valid wheel filename

Expected behavior

I am expecting pip on Windows to expand the wildcard glob, and substitute the single matching filename.

If this is something you won't fix, suggestions for a workaround would be useful.

pip version

21.1.3

Python version

3.9.5

OS

Windows

How to Reproduce

Contrived test case:

> mkdir dist # new empty dir
> cd dist
> echo > empty.whl
> dir *.whl  # confirm only one wheel
> pip install *.whl

Output

Expected behaviour is to interpret *.whl as empty.whl, thus expect:

ERROR: empty.whl is not a valid wheel filename

Actual:

WARNING: Requirement '*.whl' looks like a filename, but the file does not exist
ERROR: *.whl is not a valid wheel filename

Code of Conduct

@peterjc peterjc added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jan 19, 2022
@pfmoore
Copy link
Member

pfmoore commented Jan 19, 2022

That's a difference in the Windows and Unix shells, not a bug in pip. On Unix, the shell expands *.whl but on Windows it doesn't.

@pfmoore pfmoore added resolution: not a bug Determined as not a bug in pip and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Jan 19, 2022
@peterjc
Copy link
Author

peterjc commented Jan 19, 2022

Yes, I know. But from an end user perspective it is a frustrating behaviour change (which would be supported with the glob library when pip is run on Windows).

So this is considered a won't fix?

On the bright side, I have a work around now:

for %%w in (*.whl) do pip install %%w

Double percentage signs not needed directly at the Windows terminal.

@pfmoore
Copy link
Member

pfmoore commented Jan 19, 2022

I get your point, but making it "work" would be complex - because whether to expand is dependent on the shell, not the OS (bash on Windows is a thing, as is Powershell on Unix), so how would we write the logic? And we don't want to double-expand on shells that do expand, so "expand always" has its own issues.

IMO, it's not so much "won't fix" as "far more complicated than it's worth".

By the way, when you say "behaviour change", I assume you mean "works differently on different systems", not "used to work in older versions of pip"? Because I don't recall that we ever did a manual glob here, but I could be wrong...

@pradyunsg
Copy link
Member

This isn't something that pip should handle IMO. This is a platform-specific feature, outside of pip, and I don't think we should try to reconcile differences across platforms.

@peterjc
Copy link
Author

peterjc commented Jan 19, 2022

I've been away from Windows too long - things like this catch me by surprise. Thanks for the discussion, I agree we can close this.

@peterjc peterjc closed this as completed Jan 19, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: not a bug Determined as not a bug in pip
Projects
None yet
Development

No branches or pull requests

3 participants