Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ddebb83

Browse files
committed
Merge pull request #77 from pre-commit/rebuild_venv
Rebuild virtualenv on requirements change.
2 parents 969170b + 2bfb85e commit ddebb83

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
.project
99
.pydevproject
1010
.tox
11+
.venv.touch
1112
/venv*
1213
coverage-html
1314
dist

Makefile

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
1+
2+
REBUILD_FLAG =
3+
14
.PHONY: all
25
all: venv test
36

47
.PHONY: venv
5-
venv:
6-
tox -e venv
8+
venv: .venv.touch
9+
tox -e venv $(REBUILD_FLAG)
710

811
.PHONY: tests test
912
tests: test
10-
test:
11-
tox
13+
test: .venv.touch
14+
tox $(REBUILD_FLAG)
15+
16+
17+
.venv.touch: setup.py requirements.txt requirements_dev.txt
18+
$(eval REBUILD_FLAG := --recreate)
19+
touch .venv.touch
20+
1221

1322
.PHONY: clean
1423
clean:
1524
find . -iname '*.pyc' | xargs rm -f
1625
rm -rf .tox
1726
rm -rf ./venv-*
27+
rm -f .venv.touch

0 commit comments

Comments
 (0)