forked from gratipay/gratipay.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (52 loc) · 1.75 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
python := "$(shell { command -v python2.7 || command -v python; } 2>/dev/null)"
# Set the relative path to installed binaries under the project virtualenv.
# NOTE: Creating a virtualenv on Windows places binaries in the 'Scripts' directory.
bin_dir := $(shell $(python) -c 'import sys; bin = "Scripts" if sys.platform == "win32" else "bin"; print(bin)')
env_bin := env/$(bin_dir)
venv := "./vendor/virtualenv-1.9.1.py"
test_env_files := defaults.env,tests/test.env,tests/local.env
pip := $(env_bin)/pip
honcho := $(env_bin)/honcho
honcho_run := $(honcho) -e defaults.env,local.env run
py_test := $(honcho) -e $(test_env_files) run $(env_bin)/py.test
env: requirements.txt requirements_tests.txt setup.py
$(python) $(venv) \
--unzip-setuptools \
--prompt="[gittip] " \
--never-download \
--extra-search-dir=./vendor/ \
--distribute \
./env/
$(pip) install -r requirements.txt
$(pip) install -r requirements_tests.txt
$(pip) install -e ./
clean:
rm -rf env *.egg *.egg-info
find . -name \*.pyc -delete
schema: env
$(honcho_run) ./recreate-schema.sh
data:
$(honcho_run) $(env_bin)/fake_data fake_data
run: env
PATH=$(env_bin):$(PATH) $(honcho_run) web
py: env
$(honcho_run) $(env_bin)/python
test-schema: env
$(honcho) -e $(test_env_files) run ./recreate-schema.sh
pyflakes: env
$(env_bin)/pyflakes bin gittip tests
test: test-schema pytest jstest
pytest: env
$(py_test) --cov gittip ./tests/py/
@$(MAKE) --no-print-directory pyflakes
retest: env
$(py_test) ./tests/py/ --lf
@$(MAKE) --no-print-directory pyflakes
test-cov: env
$(py_test) --cov-report html --cov gittip ./tests/py/
tests: test
node_modules: package.json
npm install
@if [ -d node_modules ]; then touch node_modules; fi
jstest: node_modules
./node_modules/.bin/grunt test