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 raises an exception when setup.py has a URL in install_requires directive #1346

Closed
atugushev opened this issue Mar 10, 2021 · 0 comments · Fixed by #1347
Closed
Labels
bug Something is not working setuptools Related to compiling requirements form setup.py

Comments

@atugushev
Copy link
Member

atugushev commented Mar 10, 2021

Environment Versions

  1. OS Type: macOS
  2. Python version: 3.8.0
  3. pip version: 21.0.1
  4. pip-tools version: 9aeeed1

Steps to replicate

  1. Create setup.py
# setup.py
from setuptools import setup

setup(
    name="foo",
    version="0.1",
    install_requires=["six @ git+https://github.com/benjaminp/six#egg=six"],
)
  1. Run pip-compile

Expected result

Works with pip-tools==5.5.0:

$ pip-compile
#
# This file is autogenerated by pip-compile
# To update, run:
#
#    pip-compile
#
git+https://github.com/benjaminp/six#egg=six
    # via foo (setup.py)

Actual result

$ pip-compile
Traceback (most recent call last):
  File "/Users/albert/Projects/pip-tools/.venv/bin/pip-compile", line 33, in <module>
    sys.exit(load_entry_point('pip-tools', 'console_scripts', 'pip-compile')())
  File "/Users/albert/Projects/pip-tools/.venv/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/albert/Projects/pip-tools/.venv/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/albert/Projects/pip-tools/.venv/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/albert/Projects/pip-tools/.venv/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/albert/Projects/pip-tools/.venv/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/albert/Projects/pip-tools/piptools/scripts/compile.py", line 361, in cli
    [
  File "/Users/albert/Projects/pip-tools/piptools/scripts/compile.py", line 362, in <listcomp>
    install_req_from_req_string(req, comes_from=comes_from)
  File "/Users/albert/Projects/pip-tools/.venv/lib/python3.8/site-packages/pip/_internal/req/constructors.py", line 422, in install_req_from_req_string
    if (req.url and comes_from and comes_from.link and
AttributeError: 'str' object has no attribute 'link'

Additional context

/cc @astrojuanlu

@atugushev atugushev added bug Something is not working setuptools Related to compiling requirements form setup.py labels Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working setuptools Related to compiling requirements form setup.py
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant