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 leaves behind build directory #60

Closed
vbabiy opened this issue Mar 15, 2011 · 14 comments
Closed

pip install leaves behind build directory #60

vbabiy opened this issue Mar 15, 2011 · 14 comments
Labels
auto-locked Outdated issues that have been locked by automation type: bug A confirmed bug or unintended behavior

Comments

@vbabiy
Copy link
Contributor

vbabiy commented Mar 15, 2011

//pip install// leaves behind a //build// directory in the current working directory, which is a bit of a nuisance.


@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

Bump!


Original Comment By: Felix Hummel

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

Bump and wait? Not for me. Found something! Hope it makes fixing this bug a
little easier. :)

The default value for this temporary build directory is defined at

http://bitbucket.org/ianb/pip/src/tip/pip/locations.py#cl-8

and passed from install.run()

http://bitbucket.org/ianb/pip/src/tip/pip/commands/install.py#cl-139

to req.RequirementSet

http://bitbucket.org/ianb/pip/src/tip/pip/req.py#cl-688

which creates it and therefore should also remove it.


Original Comment By: Felix Hummel

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

  • Changed status from new to open.

Original Comment By: Carl Meyer

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

@felixhummel

I started looking at your bug. Could you please provide me which command
leaves the build directory, with the paths, etc...

If you could provide a real world scenario, it will be easier for me to track.
Thanks.


Original Comment By: Alexandre Conrad

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

@aconrad

Try these commands:

[1][1]

[2][2]

[3][3]

[4][4]

[5][5]

[6][6]

[7][7]

[8][8]



mkdir /tmp/x

virtualenv --no-site-packages --distribute /tmp/x/

cd /tmp/x/

. bin/activate

ls

pip install thiseggdoesnotexist

ls

# build dir was not here before...

It does not matter if pip can or cannot install the package. The build dir is
always left.


Original Comment By: 1

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

The cases of "pip leaves a build/ dir in virtualenv dir" and "pip leaves a
build/ dir in current working dir" should be separated. IMO the former is
acceptable, the latter probably not. The above command sequence doesn't
distinguish the two. What we need to track down is why/when the build dir is
created in the cwd instead of the virtualenv.


Original Comment By: Carl Meyer

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

I have a working code where the build directory is being removed. Although, I
haven't yet figured out the scenario where the build directory is created in
the CWD...


Original Comment By: Alexandre Conrad

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

Remove build directories after commands. Fixes #57

→ [Author: aconrad

Age: 11 months ago

Remove build directories after commands. Fixes 57">r526:92b4de46fb98]2

directory


Original Comment By: Ian Bicking

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

pip is still leaving the build dir. Look:

hugo@hugo-laptop:~$ mkdir fooo

hugo@hugo-laptop:~$ cd fooo/

hugo@hugo-laptop:~/fooo$ pip install --no-install initools -d .

Downloading/unpacking initools

  Downloading INITools-0.3.1.tar.gz

Saved ./INITools-0.3.1.tar.gz

Successfully downloaded initools

hugo@hugo-laptop:~/fooo$ ls

build  INITools-0.3.1.tar.gz

hugo@hugo-laptop:~/fooo$ rm -rf *

hugo@hugo-laptop:~/fooo$ workon lolcatz

(lolcatz)hugo@hugo-laptop:~/fooo$ ls /home/hugo/.virtualenvs/lolcatz/

bin  include  lib

(lolcatz)hugo@hugo-laptop:~/fooo$ pip install --no-install initools -d .

Downloading/unpacking initools

  Downloading INITools-0.3.1.tar.gz

Saved ./INITools-0.3.1.tar.gz

Successfully downloaded initools

(lolcatz)hugo@hugo-laptop:~/fooo$ ls

INITools-0.3.1.tar.gz

(lolcatz)hugo@hugo-laptop:~/fooo$ ls /home/hugo/.virtualenvs/lolcatz/

bin  build  include  lib

(lolcatz)hugo@hugo-laptop:~/fooo$

Ian was talking to me and told me that the issue could be: remove the build
dir if pip has created that. if not, don't touch.


Original Comment By: Hugo Lopes Tavares

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

insert pip-delete-this-directory.txt in every build directory pip creates
temporarily (it identifies pip created that), and always remove it if no
longer needed. it fixes issue #57 and issue #133

→ [Author: hltbra

Age: 9 months ago

insert pip-delete-this-directory.txt in every build directory pip creates
temporarily (it identifies pip created that), and always remove it if no
longer needed. it fixes issue 57 and issue 133">r697:17c2cc23b5cc]3

directory

dir-even


Original Comment By: Hugo Lopes Tavares

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

This is still happening in pip v0.8.1:

(py)roux:~/src/venv/py$ ls -1

bin

include

lib

share

(py)roux:~/src/venv/py$ pip install pep8

Downloading/unpacking pep8

  Downloading pep8-0.6.1.tar.gz

  Running setup.py egg_info for package pep8


Requirement already satisfied (use --upgrade to upgrade): distribute in

./lib/python2.7/site-packages/distribute-0.6.14-py2.7.egg (from pep8)

Installing collected packages: pep8

  Running setup.py install for pep8


    Installing pep8 script to /Users/brainsik/src/venv/py/bin

Successfully installed pep8

Cleaning up...

(py)roux:~/src/venv/py$ ls -1

bin

build

include

lib

share

(py)roux:~/src/venv/py$ ls -1 build/

pep8

pip-delete-this-directory.txt
  • Mac OS X version 10.6.5
  • Python version 2.7 (via MacPorts)
  • pip version 0.8.1

Original Comment By: jeremy avnet / .:. brainsik

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

Can you try the tip version (the one here in bitbucket) and tell me if it
still occurs? I have added a fix and I think it is solved.

Thanks, Hugo.


Original Comment By: Hugo Lopes Tavares

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

Hey, Ian just released pip 0.8.2 with that fix, can you try it, please?


Original Comment By: Hugo Lopes Tavares

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

  • Changed status from open to resolved.

Original Comment By: Hugo Lopes Tavares

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2019
This issue was closed.
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 type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant