question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

freeze looks in the wrong directory for .git directory with 'src' package convention

See original GitHub issue

If 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:closed
  • Created 11 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
granteagoncommented, Jul 25, 2014

@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.

1reaction
Permafacturecommented, Jun 12, 2014

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found