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

pip freeze generating format that's incorrectly parsed by pip install -r #2038

Closed
JordanReiter opened this issue Sep 15, 2014 · 3 comments
Closed
Labels
auto-locked Outdated issues that have been locked by automation C: freeze 'pip freeze' related C: vcs pip's interaction with version control systems like git, svn and bzr state: awaiting PR Feature discussed, PR is needed type: bug A confirmed bug or unintended behavior

Comments

@JordanReiter
Copy link

I have lines in my pip freeze output like:

-e git+git@example.com:widgets.git@3bdaf7d07c44a87c38beb1e8abd163a7edf99adc#egg=widgets
-e git+git@example.com:gadgets.git@3bda...etc...99adc#egg=gadgets

When it comes time to install using pip install -r requirements.txt it appears that pip incorrectly identifies example.com:gadgets.git@3bda...99adc as the full URL of the git repository when it fact it should just be example.com:gadgets.git and then it should check out the 3bda...99adc commit.

If I try to install using the pip freeze output, e.g.

pip install -e git+git@example.com:gadgets.git@3bdaf...99adc#egg=gadgets

I get the same error.

This is all using pip 1.5.4

@JordanReiter
Copy link
Author

Note that with the following changes it works correctly:

pip install -e git+git@example.com:/path/to/project/project.git@3bdaf...99adc#egg=project

or

pip install -e git+git@example.com:project.git#egg=project

Although in the latter, it will obviously only pull up the current commit and not the one specified in 3bdaf…

Also, for reasons I don't fathom, it does work for requests to github.

That is,

pip install -e git+git@github.com:JordanReiter/github-project.git@3bdaf...99adc#egg=github_project

works.

@xavfernandez xavfernandez added the C: freeze 'pip freeze' related label Oct 8, 2015
@pradyunsg pradyunsg added state: awaiting PR Feature discussed, PR is needed C: vcs pip's interaction with version control systems like git, svn and bzr type: bug A confirmed bug or unintended behavior labels Oct 2, 2017
@uranusjr
Copy link
Member

uranusjr commented Jan 1, 2020

This is similar to #6293. The parser (based on stdlib urlsplit has problems identifying the path part of the URL when the it contains no / at all, and identify the whole thing after + as netloc. The variant without rev works totally by accident because netloc and path are later joined back and passed to Git (which does the right thing automatically).

Discussions in #6293 seem to favour dropping SCP-style URL support entirely, so the better solution here would be fore pip freeze to spit out git+ssh:// URLs instead.

@sbidoul
Copy link
Member

sbidoul commented Jan 4, 2020

Closing as we propose to remove the git+git@ form in #7554.

@sbidoul sbidoul closed this as completed Jan 4, 2020
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Feb 3, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Feb 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: freeze 'pip freeze' related C: vcs pip's interaction with version control systems like git, svn and bzr state: awaiting PR Feature discussed, PR is needed type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

5 participants