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 install -e from git branch is not correct when done from a freeze requirements file #1735

Closed
esplinr opened this issue Apr 20, 2014 · 4 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@esplinr
Copy link

esplinr commented Apr 20, 2014

I want to install Django into Pip such that it tracks the 1.7.x branch from beta through release. This is possible with this command:

pip3 install -e  git://github.com/django/django.git@stable/1.7.x#egg=django

When I go into the Django checkout within my virtual env, git reports: "On branch stable-1.7". git pull functions correctly.

But pip3 freeze does not produce a correct requirements.txt:

pip3 freeze > requirements.txt
-e git://github.com/django/django.git@edaff9b0dffc9ad984671673214d671d84abe144#egg=Django-origin/stable/1.7.x

The git address hash in the address produced by freeze is to a specific commit on the 1.7.x branch. When I go into the Django checkout within my virtualenv, git reports: "HEAD detached at edaff9b". git pull does not see any newer changes because "You are not currently on a branch".

My environment:
Python 3.3, using a pyvenv virtual environment, and pip 1.5.4 installed with get-pip.py

My team mate is also seeing the behavior using Python 3.3 and virtualenv+pip installed through Homebrew.

I think this issue is related to #647.

@esplinr
Copy link
Author

esplinr commented Apr 20, 2014

So the problem isn't just that it is not correctly saved in the requirements.txt. Even if I put the correct URL in the requirements.txt, it still installs a detached clone that does not track the branch.

This does not work correctly:

echo "-e  git://github.com/django/django.git@stable/1.7.x#egg=django" > requirements.txt
pip3 install -r requirements.txt

But this does:

pip3 install -e  git://github.com/django/django.git@stable/1.7.x#egg=django

I think the behavior of the two approaches to installation should be identical.

@esplinr esplinr changed the title pip install -e from git branch is not correctly saved in pip freeze pip install -e from git branch is not correct when done from a freeze requirements file Apr 20, 2014
@cjerdonek
Copy link
Member

See also this issue, which relates to slashes being in the second part of the egg name: #1083

@chozabu
Copy link

chozabu commented Jun 21, 2016

Just ran into a related issue myself, after running pip install -e git+git://github.com/chozabu/django-popolo/@represent#egg=popolo
pip freeze generated a different line - which failed to install the lib

manually replacing the line in my requirements.txt with -e git+git://github.com/chozabu/django-popolo/@represent#egg=popolo fixes my issue, but will probably be annoying to maintain

@dstufft
Copy link
Member

dstufft commented Mar 30, 2017

I'm going to close this as a duplicate of #2037 (because that issue also has a PR waiting to be reviewed to fix it).

@dstufft dstufft closed this as completed Mar 30, 2017
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
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
Projects
None yet
Development

No branches or pull requests

4 participants