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 freeze --requirement doesn't accept inline comments #3680

Closed
rudolphfroger opened this Issue May 12, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@rudolphfroger

rudolphfroger commented May 12, 2016

  • Pip version: 8.1.2
  • Python version: 2.7.11
  • Operating System: Mac OS X

Description:

pip freeze --requirement doesn't accept inline comments

What I've run:

pip freeze -r requirements.txt

Output:

Invalid requirement: 'alembic==0.8.6                          # MIT license'
Traceback (most recent call last):
  File ".../site-packages/pip/req/req_install.py", line 78, in __init__
    req = Requirement(req)
  File ".../site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
    requirement_string[e.loc:e.loc + 8]))
InvalidRequirement: Invalid requirement, parse error at "'# MIT li'"

requirements.txt:

alembic==0.8.6                          # MIT license
Babel==2.3.4                            # BSD license

pip install -r works for this requirements.txt file.

Documentation states:

Whitespace followed by a # causes the # and the remainder of the line to be treated as a comment.

@rudolphfroger

This comment has been minimized.

Show comment
Hide comment
@rudolphfroger

rudolphfroger May 12, 2016

Just confirmed that pip version 8.1.1 doesn't have this bug

rudolphfroger commented May 12, 2016

Just confirmed that pip version 8.1.1 doesn't have this bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment