-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (42 loc) · 1.49 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
# https://gist.github.com/paulfurley/869df266ef36231014f434686202eb9f
# Put *unversioned* requirements in `requirements-to-freeze.txt` as described below.
# `requirements.txt` will be automatically generated from `pip freeze`
# https://www.kennethreitz.org/essays/a-better-pip-workflow
venv/bin/activate: requirements-to-freeze.txt
rm -rf venv/
test -f venv/bin/activate || virtualenv -p $(shell which python3) venv
. venv/bin/activate ;\
pip install -Ur requirements-to-freeze.txt ;\
pip freeze | sort > requirements.txt
touch venv/bin/activate # update so it's as new as requirements-to-freeze.txt
venv_lint: venv/bin/activate
. venv/bin/activate ; \
venv/bin/flake8
venv_test: venv/bin/activate
. venv/bin/activate ; \
venv/bin/pytest -sv
lint:
flake8
test:
pytest -s
release: check-version check-local-changes venv/bin/activate
@. venv/bin/activate ; \
pip install twine ; \
echo Versioning... ; \
awk '{sub(/'[0-9.]+'/,"${VERSION}")}1' src/migrator/__init__.py > temp.txt && mv temp.txt src/migrator/__init__.py; \
git add src/migrator/__init__.py ; \
git commit -m "Release ${VERSION}" ; \
echo Tagging... ; \
git tag -a ${VERSION} -m "Release of version ${VERSION}" ; \
echo Pushing... ; \
git push --follow-tags ; \
echo "Packaging..."; \
python3 setup.py sdist bdist_wheel > /dev/null 2>&1; \
echo "Releasing to PyPi..."; \
python3 -m twine upload dist/*${VERSION}*
check-version:
ifndef VERSION
$(error VERSION ${VERSION} is undefined)
endif
check-local-changes:
./local-changes.sh