Closed ei-grad closed 5 years ago
Hm... I couldn't reproduce it with the clean pip install -e
environment, there is a second condition - to execute the git.commit
via GitPython, and it only taking place in tests run and syntetic case like this:
git init test1754 && cd test1754
echo -e '#!/bin/sh\npython -c "import dvc"' > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
The hook could also be installed by dvc install
, the python -c "import dvc"
is here just to reduce the scope for reprodution.
virtualenv env
source env/bin/activate
pip install -e git+https://github.com/iterative/dvc.git#egg=dvc
from tempfile import mktemp
import os
import git
fname = mktemp(prefix='', dir='') with open(fname, 'w') as f: f.write(fname + '\n')
repo = git.Repo() repo.index.add([fname]) repo.index.commit(fname)
4. and run `python test.py`:
Traceback (most recent call last):
File "test.py", line 12, in
The
import dvc
fails on_update_version_file
if it is run from the pre-commit git hook. The_update_version_file()
function is called if dvc is installed in editable mode (withpip install -e
) and during thepython -m tests
run.Steps to reproduce
python -m tests tests/test_install.py
.Traceback