tox freezes when pip installing from vcs in requirements.txt

Issue #286 on hold
Maik Figura created an issue

I am using tox to pip install dependencies from a requirements.txt file.One of these dependencies is a repository. I am using pip's facility to install directly from the vcs:

http://pip.readthedocs.org/en/stable/reference/pip_install/#git

I noticed that when the environments are created everything is fine, but as soon as I run tox -r and the environment with the cloned dependency inside exists, tox freezes, because it tries to clone the repository again but fails (as it already exists).

Currently, the only solution to is to manually delete the environment (in my case the .tox folder).

Log output of tox -r -v (I removed the ignoreerrors=1 in make_emptydir):

WindowsError: [Error 5] Access is denied: 'C:\\Users\\me\\repos\\myproject\\.tox\\py27\\src\\anotherproject\\.git\\objects\\pack\\pack-9620b5d62dba6f0eb22cf2f802db22244f3cdab7.idx'

Comments (10)

  1. Florian Bruhin

    How can this be reproduced? I never had any issues with VCS installs and -r.

    Can you run with -v and see where it hangs?

  2. Maik Figura reporter

    Tested this a bit further and it seems to be a rmtree 'issue'. On Windows the .git directory is set as read only. So rmtree removes all but the .git directory and then pip tries to clone the repository again. Rmtree fails on these. I am not sure if this is something Tox should work around (I uess I could provide a patch) or something I should discuss in the rmtree issue tracker. There is a stackoverflow (http://stackoverflow.com/questions/4829043/how-to-remove-read-only-attrib-directory-with-python-in-windows) post suggesting a workaround with an onerror handler and I guess rmtree will not 'fix' this behavior, as one can handle this with the onerror handler @hpk42 do you have any opinion on this?

    I haven't tested this with a minimal example (manually deleting directories, using pip directly, etc) but I will.

  3. Log in to comment