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-compile fails when using -f in requirements.in #66

Closed
graingert opened this issue Dec 10, 2013 · 9 comments
Closed

pip-compile fails when using -f in requirements.in #66

graingert opened this issue Dec 10, 2013 · 9 comments

Comments

@graingert
Copy link
Member

Traceback (most recent call last):
  File "/home/graingert/.virtualenvs/test/bin/pip-compile", line 150, in <module>
    main()
  File "/home/graingert/.virtualenvs/test/bin/pip-compile", line 141, in main
    compile_specs(src_files, dry_run=args.dry_run)
  File "/home/graingert/.virtualenvs/test/bin/pip-compile", line 81, in compile_specs
    top_level_specs = list(collect_source_specs(source_files))
  File "/home/graingert/.virtualenvs/test/bin/pip-compile", line 75, in collect_source_specs
    for spec in walk_specfile(filename):
  File "/home/graingert/.virtualenvs/test/bin/pip-compile", line 66, in walk_specfile
    spec = Spec.from_line(line, source='{0}:{1}'.format(filename, lineno))
  File "/home/graingert/.virtualenvs/test/local/lib/python2.7/site-packages/piptools/datastructures.py", line 67, in from_line
    req = Requirement.parse(line)
  File "/home/graingert/.virtualenvs/test/local/lib/python2.7/site-packages/pkg_resources.py", line 2914, in parse
    reqs = list(parse_requirements(s))
  File "/home/graingert/.virtualenvs/test/local/lib/python2.7/site-packages/pkg_resources.py", line 2839, in parse_requirements
    line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
  File "/home/graingert/.virtualenvs/test/local/lib/python2.7/site-packages/pkg_resources.py", line 2807, in scan_list
    raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', '-f http://example.com/pypi/', 'at', ' http://example.com/pypi/')
@graingert
Copy link
Member Author

Is this was @sontek was getting at in #65?

@edoshor
Copy link

edoshor commented Jan 1, 2014

Happens with pip-review as well.

Traceback (most recent call last):
  File "/home/edos/projects/accounts/venv/bin/pip-review", line 269, in <module>
    main()
  File "/home/edos/projects/accounts/venv/bin/pip-review", line 229, in main
    installed = list(get_installed_pkgs(local=args.local))
  File "/home/edos/projects/accounts/venv/bin/pip-review", line 147, in get_installed_pkgs
    name, version = line.split('==')
ValueError: need more than 1 value to unpack

pip freeze gives:

-f /home/edos/.pip/repo/
...

@nvie
Copy link
Member

nvie commented Jan 2, 2014

Seems like we should be able to simply ignore these entries? Not sure when they occur in pip freeze output, but happy to accept a patch that fixes this.

@svetlyak40wt
Copy link
Contributor

I belive, @coagulant already solved this issue: coagulant@2b1f0bc. But seems, he forgot to make a pull request.

@edoshor
Copy link

edoshor commented Jan 5, 2014

It happens to me when I use find-links in my global pip.conf

@coagulant
Copy link
Contributor

@svetlyak40wt dependency_links is not the same as find-links. Anyway pip no longer respects dependency links by default since 1.5, so I don't think it's worth merging as is.

@simonluijk
Copy link

I am getting the same error in pip-review when pip freeze outputs -f file:///home/simon/.wheelhouse.

Simply ignoring any line starting with '-f' solved the issue. I don't know about side effects though.

simonluijk referenced this issue in coagulant/pip-tools Jun 3, 2014
…em to package manager

If we simply ignore dependency_links, requirements with such links will crash whole compilation. We're mitigating this problem, however, pip install -r requirements.txt might still fail in case requirement from dependency_links happens to be before the package that requestsed it.
@nvie
Copy link
Member

nvie commented Jul 23, 2014

I'm closing old issues. If this issue still applies and requires my attention, I ask you kindly to re-open it or file a new issue. Thanks.

@nvie nvie closed this as completed Jul 23, 2014
@blueyed
Copy link
Contributor

blueyed commented Mar 17, 2015

For reference: #93 is about a similar issue for -e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants