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 freeze generating invalid requirement URL for package on Git #1125

Closed
mwaterfall opened this issue Aug 9, 2013 · 5 comments
Closed

pip freeze generating invalid requirement URL for package on Git #1125

mwaterfall opened this issue Aug 9, 2013 · 5 comments
Labels
auto-locked Outdated issues that have been locked by automation C: freeze 'pip freeze' related C: vcs pip's interaction with version control systems like git, svn and bzr type: bug A confirmed bug or unintended behavior

Comments

@mwaterfall
Copy link

When installing a package from a Git repo on GitHub, I added the following in my requirements file:

-e git+https://github.com/mwaterfall/html2text.git@0aa79aa386348574709f9367b5d86fce79c7364e#egg=html2text-no-markdown

I chose the egg name myself (which I believe is okay) and consists of the repo name followed by the branch name. The commit specified is on the branch 'no-markdown'.

Running pip install -r requirements.txt installs it correctly.

However, when I run pip freeze > requirements.txt, pip reformats the url to:

-e git+https://github.com/mwaterfall/html2text.git@0aa79aa386348574709f9367b5d86fce79c7364e#egg=html2text-origin/no-markdown

If I then immediately run pip install -r requirements.txt again I get the following error:

Exception:
Traceback (most recent call last):
  File "/Users/mwaterfall/.virtualenvs/my_project/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/basecommand.py", line 134, in main
    status = self.run(options, args)
  File "/Users/mwaterfall/.virtualenvs/my_project/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/commands/install.py", line 220, in run
    for req in parse_requirements(filename, finder=finder, options=options):
  File "/Users/mwaterfall/.virtualenvs/my_project/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/req.py", line 1475, in parse_requirements
    line, comes_from=comes_from, default_vcs=options.default_vcs if options else None)
  File "/Users/mwaterfall/.virtualenvs/my_project/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/req.py", line 87, in from_editable
    res = cls(name, comes_from, source_dir=source_dir, editable=True, url=url, prereleases=True)
  File "/Users/mwaterfall/.virtualenvs/my_project/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/req.py", line 44, in __init__
    req = pkg_resources.Requirement.parse(req)
  File "/Users/mwaterfall/.virtualenvs/my_project/lib/python2.7/site-packages/pkg_resources.py", line 2725, in parse
    reqs = list(parse_requirements(s))
  File "/Users/mwaterfall/.virtualenvs/my_project/lib/python2.7/site-packages/pkg_resources.py", line 2650, in parse_requirements
    line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
  File "/Users/mwaterfall/.virtualenvs/my_project/lib/python2.7/site-packages/pkg_resources.py", line 2618, in scan_list
    raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', 'html2text-origin/no-markdown', 'at', '/no-markdown')

I believe this is because of the forward slash that pip has put in the egg name (html2text-origin/no-markdown).

So I'm a bit stuck as I can't rely on simply outputting pip freeze to my requirements file anymore.

I'm running pip 1.4.1 and git 1.8.3.2. There were issues with git >= 1.8.3 which was resolved in pip 1.4, but I'm wondering if this is an outstanding issue.

@tiliv
Copy link

tiliv commented Aug 21, 2013

Pip 1.3 appears to not do this-- it doesn't put branch information on the egg name. I'm having the same issue while using Pip 1.4 and git 1.8.3.4

@paulmelnikow
Copy link

+1. I'm seeing this with pip 1.4.1 and git 1.8.3.4.

@cjerdonek
Copy link
Member

I also hit this, and I confirmed it still happens in pip 1.5.

@cjerdonek
Copy link
Member

Actually, this looks to be a duplicate of issue #1083 and so can be closed, right?

@mwaterfall
Copy link
Author

Yep looks like it — thanks! I'll close this so the focus can be on #1083.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 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 C: freeze 'pip freeze' related C: vcs pip's interaction with version control systems like git, svn and bzr type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants