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

Only strip VCS prefix for URIs with vcs+ patterns #1128

Merged

Conversation

techalchemy
Copy link
Member

- Fixes pypa#1126
- Does a simple check before stripping the VCS prefix on
a requirement.uri in pipenv.utils.convert_deps_from_pip
Copy link
Member

@nateprewitt nateprewitt left a 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://')
Copy link
Member

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?

Copy link
Member Author

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:
Copy link
Member

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.

Copy link
Member Author

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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooh my bad

@techalchemy techalchemy force-pushed the bugfix/1126-malformed-vcs-url-lockfile branch from 3e747b4 to ce01575 Compare November 27, 2017 17:51
- Only remove 'vcs+' pattern from URI in convert_deps_from_pip if the
requirement uri explicitly begins with requirement.vcs+
@techalchemy techalchemy force-pushed the bugfix/1126-malformed-vcs-url-lockfile branch from ce01575 to de02f53 Compare November 27, 2017 17:55
Copy link
Member

@nateprewitt nateprewitt left a 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 ✨

@nateprewitt nateprewitt merged commit 704c622 into pypa:master Nov 27, 2017
@techalchemy techalchemy deleted the bugfix/1126-malformed-vcs-url-lockfile branch April 1, 2018 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pipenv fails to install from github by ref and tag
2 participants