forked from dynaconf/dynaconf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
127 lines (96 loc) · 3.39 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
SHELL := /bin/bash
.PHONY: all citest clean mypy dist docs install publish run-pre-commit run-tox setup-pre-commit test test_functional test_only test_redis test_vault help coverage-report watch_test
help:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
all: clean install run-pre-commit test test_functional coverage-report
test_functional:
./tests_functional/runtests.py
test_vault:
./tests_functional/test_vault.sh
./tests_functional/test_vault_userpass.sh
test_redis:
./tests_functional/test_redis.sh
watch:
ls **/**.py | entr py.test -m "not integration" -s -vvv -l --tb=long --maxfail=1 tests/
watch_test:
# make watch_test ARGS="tests/test_typed.py -k union"
ls **/**.py | entr py.test --showlocals -sx -vv --disable-warnings --tb=short $(ARGS)
watch_django:
ls {**/**.py,~/.virtualenvs/dynaconf/**/**.py,.venv/**/**.py} | PYTHON_PATH=. DJANGO_SETTINGS_MODULE=foo.settings entr tests_functional/django_example/manage.py test polls -v 2
watch_coverage:
ls {**/**.py,~/.virtualenvs/dynaconf/**/**.py} | entr -s "make test;coverage html"
test_only:
py.test -m "not integration" -v --cov-config .coveragerc --cov=dynaconf -l --tb=short --maxfail=1 tests/
coverage xml
test_integration:
py.test -m integration -v --cov-config .coveragerc --cov=dynaconf --cov-append -l --tb=short --maxfail=1 tests/
coverage xml
coverage-report:
coverage report
mypy:
mypy dynaconf/ --exclude '^dynaconf/vendor*'
test: mypy test_only
citest:
py.test -v --cov-config .coveragerc --cov=dynaconf -l tests/ --junitxml=junit/test-results.xml
coverage xml
make coverage-report
ciinstall:
python -m pip install --upgrade pip
python -m pip install -r requirements_dev.txt
test_all: test_functional test_integration test_redis test_vault test
@coverage html
install:
pip install --upgrade pip
pip install -r requirements_dev.txt
run-pre-commit:
rm -rf .tox/
rm -rf build/
pre-commit run --all-files
dist: clean
@make minify_vendor
@python setup.py sdist bdist_wheel
@make source_vendor
# Bump
# Used if we want a minor release.
bump-minor:
bump-my-version bump minor
# Release
# 1. Create release-commit: bump-version to stable + changelog-update + build package
# 2. Create bump-commit: bump-version to next cycle
release: clean
./scripts/release-main.sh
# Publish
# 1. Publish to PiPY
# 2. TODO: Publish to Github (Github Release)
publish:
@twine upload dist/*
clean:
@find ./ -name '*.pyc' -exec rm -f {} \;
@find ./ -name '__pycache__' -prune -exec rm -rf {} \;
@find ./ -name 'Thumbs.db' -exec rm -f {} \;
@find ./ -name '*~' -exec rm -f {} \;
rm -rf .cache
rm -rf build
rm -rf dist
rm -rf *.egg-info
rm -rf htmlcov
rm -rf .tox/
rm -rf site
docs:
rm -rf site
mkdocs build --clean
run-tox:
tox --recreate
rm -rf .tox
minify_vendor:
# Ensure vendor is source and cleanup vendor_src backup folder
ls dynaconf/vendor/source && rm -rf dynaconf/vendor_src
# Backup dynaconf/vendor folder as dynaconf/vendor_src
mv dynaconf/vendor dynaconf/vendor_src
# create a new dynaconf/vendor folder with minified files
./minify.sh
source_vendor:
# Ensure dynaconf/vendor_src is source and cleanup vendor folder
ls dynaconf/vendor_src/source && rm -rf dynaconf/vendor
# Restore dynaconf/vendor_src folder as dynaconf/vendor
mv dynaconf/vendor_src dynaconf/vendor