Skip to content

Pipenv does not support vcs correctly with pip 9 #2912

Closed
@jxltom

Description

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'
```

Metadata

Assignees

No one assigned

    Labels

    Category: VCSRelates to version control system dependencies.Type: Bug 🐛This issue is a bug.Type: Vendored DependenciesThis issue affects vendored dependencies within pipenv.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions