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

Failed lock on editable VCS module (with specific git reference) #5179

Closed
mgmarino opened this issue Jul 19, 2022 · 2 comments · Fixed by #5183
Closed

Failed lock on editable VCS module (with specific git reference) #5179

mgmarino opened this issue Jul 19, 2022 · 2 comments · Fixed by #5183
Assignees
Labels
Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.

Comments

@mgmarino
Copy link
Contributor

mgmarino commented Jul 19, 2022

Issue description

We use private modules installed in editable mode per the docs that reference a specific git tag. An example entry in our Pipfile:

our_package = {git = "ssh://git@github.com/mycomp/our-repo.git", editable = true, ref = "release/v318"}

As of pipenv 2022.7.4, this now fails to lock, with an error that looks like:

pipenv.patched.notpip._internal.exceptions.InstallationSubprocessError: git clone --filter=blob:none 'ssh://****@github.com/mycomp/ourrepo.git@release/v318' /var/folders/jh/0_l94d8n51n2gjzt_5l8mv8r0000gq/T/requirementslib-3i6fm8qz-src/our_package exited with 128

If you look closely, you see that the @release/v318 is included in the clone command, which it should not be.

It worked as of 2022.6.7

Here is my analysis, though I'm not entirely sure of the correct solution. It seems to involve an upstream change to requirementslib. If this is so, I'm happy to open an issue there as well.

2022.6.7

>>> from pipenv.vendor.requirementslib import __version__
>>> __version__
'1.6.4'
>>> from pipenv.vendor.requirementslib.models.requirements import Line
>>> Line("-e git+ssh://git@github.com/mycomp/our_repo.git@release/v318#egg=our_package")
<Line (editable=True, name=our_package, path=None, uri=git+ssh://git@github.com/mycomp/our_repo.git, extras=(), markers=None, vcs=git, specifier=None, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=None)>

2022.7.4

>>> from pipenv.vendor.requirementslib import __version__
>>> __version__
'1.6.6'
>>> from pipenv.vendor.requirementslib.models.requirements import Line
>>> Line("-e git+ssh://git@github.com/mycomp/our_repo.git@release/v318#egg=our_package")
<Line (editable=True, name=our_package, path=None, uri=git+ssh://git@github.com/mycomp/our_repo.git@release/v318, extras=(), markers=None, vcs=git, specifier=None, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=None)>

The problem is possibly more apparent when you look at Requirement.from_line:

2022.6.7

>>> from pipenv.vendor.requirementslib.models.requirements import Requirement
>>> Requirement.from_line("-e git+ssh://git@github.com/mycomp/our_repo.git@release/v318#egg=our_package").pipfile_entry
('our_package', {'editable': True, 'ref': 'release/v318', 'git': 'ssh://git@github.com/mycomp/our_repo.git'})

2022.7.4

>>> from pipenv.vendor.requirementslib.models.requirements import Requirement
>>> Requirement.from_line("-e git+ssh://git@github.com/mycomp/our_repo.git@release/v318#egg=our_package").pipfile_entry
('our_package', {'editable': True, 'git': 'ssh://git@github.com/mycomp/our_repo.git@release/v318'})

Sorry for not following the normal issue format, but I hope the above analysis is still clear.

I'm happy to provide more information, and I'm also happy to open an issue (+ a PR) on the requirementslib side.

@matteius
Copy link
Member

@mgmarino I haven't had a chance to deep dive any of this yet, but I am sure that it is caused by: sarugaku/requirementslib#310 CC @jervi

mgmarino added a commit to mgmarino/requirementslib that referenced this issue Jul 20, 2022
@mgmarino
Copy link
Contributor Author

Thanks @matteius I have a fix. I'll open up an issue over there and push a PR. I'll leave this one open to track for now.

matteius pushed a commit to sarugaku/requirementslib that referenced this issue Jul 21, 2022
* Make split ref test data driven

This makes it cleaner to add additional test cases.

* Add failing test case for VCS with ref and user

See pypa/pipenv#5179

* Fix handling non-file-like uris with @ signs

* Add news issue
@matteius matteius self-assigned this Jul 22, 2022
@matteius matteius added the Type: Vendored Dependencies This issue affects vendored dependencies within pipenv. label Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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