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

Pipenv does not support vcs correctly with pip 9 #2912

Closed
jxltom opened this issue Oct 3, 2018 · 2 comments · Fixed by #2916
Closed

Pipenv does not support vcs correctly with pip 9 #2912

jxltom opened this issue Oct 3, 2018 · 2 comments · Fixed by #2916
Labels
Category: VCS Relates to version control system dependencies. Type: Bug 🐛 This issue is a bug. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.

Comments

@jxltom
Copy link
Contributor

jxltom commented Oct 3, 2018

Issue description

For the lastest master branch, pipenv can not lock editable packages using vcs when pip version is 9.0.1.

It looks like new added pip-shim is using system's pip instead of built-in patched version patched.notpip in pipenv. Is this intended?

BASE_IMPORT_PATH = os.environ.get("PIP_SHIMS_BASE_MODULE", "pip")

For pip 9, there is no is_commit_id_equal attribute for vcs object. That's why this error is raised.

Expected result

pipenv lock --clear should work.

Actual result

Following error will be raised when try locking following Pipfile using pipenv lock --clear

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
pytest = {git = "https://github.com/pytest-dev/pytest.git", ref = "3.8.1", editable = true}
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/cli/command.py", line 316, in lock
    pypi_mirror=state.pypi_mirror,
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/core.py", line 1053, in do_lock
    dev=settings["dev"],
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/utils.py", line 1172, in get_vcs_deps
    with requirement.req.locked_vcs_repo(src_dir=src_dir) as repo:
  File "/opt/python/3.6.3/lib/python3.6/contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 617, in locked_vcs_repo
    vcsrepo = self.get_vcs_repo(src_dir=src_dir)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 595, in get_vcs_repo
    vcsrepo.obtain()
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/vcs.py", line 37, in obtain
    self.checkout_ref(self.ref)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/vcs.py", line 44, in checkout_ref
    if not self.repo_instance.is_commit_id_equal(
AttributeError: 'Git' object has no attribute 'is_commit_id_equal'
```
@techalchemy
Copy link
Member

It looks like new added pip-shim is using system's pip instead of built-in patched version patched.notpip in pipenv. Is this intended?

Nope, definitely not intended! I have a local branch which keeps this set properly but I don't think I've pushed this up yet. Thanks for digging into this!

@techalchemy techalchemy added Type: Bug 🐛 This issue is a bug. Category: VCS Relates to version control system dependencies. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv. labels Oct 4, 2018
jxltom added a commit to jxltom/pipenv that referenced this issue Oct 4, 2018
@jxltom
Copy link
Contributor Author

jxltom commented Oct 4, 2018

@techalchemy Thanks for the reply. How about this fix? #2916. Please review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: VCS Relates to version control system dependencies. Type: Bug 🐛 This issue is a bug. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants