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 wheel should not create wheels that it will itself deem invalid #4169

Closed
anntzer opened this issue Dec 10, 2016 · 3 comments · Fixed by #4384
Closed

pip wheel should not create wheels that it will itself deem invalid #4169

anntzer opened this issue Dec 10, 2016 · 3 comments · Fixed by #4384
Labels
auto-locked Outdated issues that have been locked by automation type: bug A confirmed bug or unintended behavior
Milestone

Comments

@anntzer
Copy link
Contributor

anntzer commented Dec 10, 2016

  • Pip version: 9.0.1
  • Python version: 3.5.2
  • Operating System: Arch Linux

Description:

pip wheel can create wheels that pip install will deem invalid. This should not be the case.

What I've run:

setup.py

from setuptools import setup
setup(name="foo", version="!invalid!")

then

$ pip wheel . && pip install *.whl
Processing /tmp/foo
Building wheels for collected packages: foo
  Running setup.py bdist_wheel for foo ... done
  Stored in directory: /tmp/foo
Successfully built foo
foo-_invalid_-py3-none-any.whl is not a valid wheel filename.
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3.5/site-packages/pip/commands/install.py", line 312, in run
    wheel_cache
  File "/usr/lib/python3.5/site-packages/pip/basecommand.py", line 276, in populate_requirement_set
    wheel_cache=wheel_cache
  File "/usr/lib/python3.5/site-packages/pip/req/req_install.py", line 221, in from_line
    wheel = Wheel(link.filename)  # can raise InvalidWheelFilename
  File "/usr/lib/python3.5/site-packages/pip/wheel.py", line 631, in __init__
    "%s is not a valid wheel filename." % filename
pip.exceptions.InvalidWheelFilename: foo-_invalid_-py3-none-any.whl is not a valid wheel filename.

pip wheel doesn't even bother to warn on the version name.

As a side note, note that "interestingly", pip install . (installation from the directory) works just fine.
As a further note, I think that internal exceptions from pip should, by default, not display a traceback.

@xavfernandez
Copy link
Member

Indeed the https://github.com/pypa/pip/blob/b559221/pip/wheel.py#L584-L588 regex seems a little too strict compared to the https://www.python.org/dev/peps/pep-0427/ requirements.

@xavfernandez xavfernandez added the type: bug A confirmed bug or unintended behavior label Dec 10, 2016
@xavfernandez xavfernandez added this to the 9.1 milestone Dec 10, 2016
@xavfernandez
Copy link
Member

The real issue being that pip should actually install this valid wheel (with a invalid/non PEP-440 version number).

@anntzer
Copy link
Contributor Author

anntzer commented Dec 11, 2016

I don't have a preference, other than consistency.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants