forked from project-callisto/django-wizard-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
96 lines (80 loc) · 3.03 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
VERSION := $(shell cat wizard_builder/version.txt)
DATA_FILE := wizard_builder/fixtures/wizard_builder_data.json
help:
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}'
clean:
make clean-lint
make clean-build
clean-lint: ## run the cleanup functions for the linters
autopep8 wizard_builder/ -raai
isort -rc wizard_builder/
make test-lint
test-lint: ## lint with isort and flake8
flake8 wizard_builder/
isort --check-only --diff --quiet -rc wizard_builder/
test-fast:
pytest -vlsx --ff --reuse-db --ignore=wizard_builder/tests/test_frontend.py --ignore=wizard_builder/tests/test_admin.py --ignore=wizard_builder/tests/test_migrations.py
test-local-suite:
python manage.py check
pytest -v --ignore wizard_builder/tests/test_frontend.py --ignore wizard_builder/tests/test_admin.py
pytest -v wizard_builder/tests/test_frontend.py
pytest -v wizard_builder/tests/test_admin.py
install-pip:
pip install -r requirements/test.txt --upgrade
install-osx:
make install-pip
brew install git pyenv postgres chromedriver
test-callisto-core:
pip install callisto-core --upgrade
pip show callisto-core |\
grep 'Location' |\
sed 's/Location: \(.*\)/\1\/callisto_core\/requirements\/test.txt/' |\
xargs -t pip install --upgrade -r
pip uninstall -y django-wizard-builder
pip install -e .
pip show callisto-core |\
grep 'Location' |\
sed 's/Location: \(.*\)/\1\/callisto_core\/tests/' |\
xargs -t pytest -v --ds=wizard_builder.tests.callisto_core_settings
test-all:
make test-lint
make test-local-suite
make test-callisto-core
clean-build: ## clean the repo in preparation for release
rm -fr build/
rm -fr dist/
rm -fr *.egg-info
rm -rf wizard_builder/tests/screendumps/
rm -rf wizard_builder/tests/staticfiles/
find wizard_builder -name '*.pyc' -exec rm -f {} +
find wizard_builder -name '*.pyo' -exec rm -f {} +
find wizard_builder -name '*~' -exec rm -f {} +
find wizard_builder -type d -name "__pycache__" -exec rm -rf {} +
release: ## package and upload a release
make clean-build
python setup.py sdist upload
python setup.py bdist_wheel upload
git tag -a $(VERSION) -m 'version $(VERSION)'
git push --tags
git push
make clean-build
app-setup: ## setup the test application environment
- rm wizard_builder_test_app.sqlite3
- python manage.py flush --noinput
python manage.py migrate --noinput
python manage.py create_admins
python manage.py setup_sites
make load-fixture
shell: ## manage.py shell_plus with dev settings
DJANGO_SETTINGS_MODULE='wizard_builder.tests.test_app.dev_settings' python manage.py shell_plus
load-fixture: ## load fixture from file
python manage.py loaddata $(DATA_FILE)
update-fixture: ## update fixture with migrations added on the local branch
git checkout master
- rm wizard_builder_test_app.sqlite3
- python manage.py migrate
- python manage.py loaddata $(DATA_FILE) -i
git checkout @{-1}
python manage.py migrate
python manage.py dumpdata wizard_builder -o $(DATA_FILE)
npx json -f $(DATA_FILE) -I