freeze looks in the wrong directory for .git directory with 'src' package convention
See original GitHub issueIf a package uses the convention that it puts its files in a “src” directory, then when you install from git, “pip freeze” will not recognize that it has been installed from a git repository.
One example is the piplint package.
To reproduce this bug using piplint:
$ pip install -e git://github.com/dcramer/piplint.git#egg=piplint-dev
$ pip freeze | grep piplint
piplint==0.1.1
Output should have been:
-e git://github.com/dcramer/piplint.git@c1c7921784d0315b659e0b53a2752ee5f0d202fe#egg=piplint-dev
The problem seems to be that “pip freeze” is looking in the wrong place for the “.git” directory. The location variable (I’m running pip 1.1) seems to be set to the $VENV/src/piplint/src/.git
directory instead of $VENV/src/piplint/.git
Piplint has this in its setup.py:
setup(
...
package_dir={'': 'src'},
...
)
And then it puts the code in src/piplint. Note that if the package_dir line is removed and the files are moved up from src/piplint to piplint, then the bug no longer manifests itself.
Issue Analytics
- State:
- Created 11 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
9 Answers - 9 - Stack Overflow
Just move your .git to root directory and tell git to remember all files changes with --all option. $ mv .git ..
Read more >yarn install fails with `ENOENT: no such file or directory ...
Running yarn install as part of a build step for a Docker image based on node:7 fails on Travis CI with ENOTEMPTY, EEXISTS...
Read more >How to Get Started with GIT and work with GIT Remote Repo
Setup the Working Directory for a New Project. Let's start a programming project under the working directory called " hello-git ", with one...
Read more >Repository storage types - GitLab Docs
To look up a project's name using the config file in the *.git directory: Navigate to the to the *.git directory. This directory...
Read more >Rebuilding Git in Ruby - Thoughtbot
Notice that we now have a file in the objects directory. It contains the compressed source of bin/rgit . Finally, our index looks...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Permafacture I think your issue is related to not using the -e flag. If you don’t use that, pip will create a temporary build directory and will delete the dir after the build.
There may be a subtlety I’m missing but this is apparently fixed. In my case, the correct usage is:
pip install -e git://[github URL]#egg=Blah
Where github url is something like github.com/dcramer/piplint.git (so you’ve got to name the egg with the hash at the end). Check pip freeze afterwards to see that it worked.