-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Only strip VCS prefix for URIs with vcs+ patterns #1128
Only strip VCS prefix for URIs with vcs+ patterns #1128
Conversation
- Fixes pypa#1126 - Does a simple check before stripping the VCS prefix on a requirement.uri in pipenv.utils.convert_deps_from_pip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright looks like we're almost there, left a few notes to address. Thanks @techalchemy!
pipenv/utils.py
Outdated
@@ -45,7 +45,7 @@ | |||
|
|||
# List of version control systems we support. | |||
VCS_LIST = ('git', 'svn', 'hg', 'bzr') | |||
SCHEME_LIST = ('http://', 'https://', 'ftp://', 'file://') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this getting added to the scheme list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
erm, it shouldn't be necessary, sorry for the sloppy PR that was my early hope that just adding it to the scheme list would pick it up in the logic
pipenv/utils.py
Outdated
@@ -661,8 +661,10 @@ def convert_deps_from_pip(dep): | |||
req.path = None | |||
|
|||
# Crop off the git+, etc part. | |||
dependency.setdefault(req.name, {}).update({req.vcs: req.uri[len(req.vcs) + 1:]}) | |||
|
|||
if '+' in req.uri: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I don't know if the +
check by itself will be sufficient. That's a legal character in the path as well. We need to determine if there's a + explicitly in the scheme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah good call
pipenv/utils.py
Outdated
if '+' in req.uri: | ||
req.uri = req.uri[len(req.vcs) + 1:] | ||
dependency.setdefault(req.name, {}).update({req.vcs: req.uri}) | ||
print('dependency: {}'.format(dependency)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh my bad
3e747b4
to
ce01575
Compare
- Only remove 'vcs+' pattern from URI in convert_deps_from_pip if the requirement uri explicitly begins with requirement.vcs+
ce01575
to
de02f53
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, looks like we're good here ✨
a
requirement.uri
inpipenv.utils.convert_deps_from_pip