-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (31 loc) · 1.05 KB
/
Makefile
File metadata and controls
42 lines (31 loc) · 1.05 KB
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
LIBPATH=venv
PYTHON?=python3
export PYTHONPATH = $(LIBPATH)
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
MKDIR := $(dir $(mkfile_path))
VERSION_NEW := ${shell git tag -l v[0-9]* | sort -V -r | head -n1 | awk '/v/{split($$NF,v,/[.]/); $$NF=v[1]"."v[2]"."++v[3]}1'}
test: compile
$(PYTHON) -m pytest --cov --junitxml junit.xml
compile: $(LIBPATH)
$(LIBPATH): requirements.txt requirements/*
$(PYTHON) -m pip -V || wget -qO- https://bootstrap.pypa.io/get-pip.py | $(PYTHON)
$(PYTHON) -m pip install --target $(LIBPATH) -r requirements.txt
touch $(LIBPATH)
tox: compile
tox
staging:
# twine upload --repository-url https://test.pypi.org/legacy/ dist/*
package: compile
rm -rf dist
@echo "$(VERSION_NEW)" | sed -e s/v// > VERSION
git tag "$(VERSION_NEW)"
$(PYTHON) setup.py sdist
publish: package
$(PYTHON) -m twine upload dist/* || echo "ERROR: pushing to pypi. Already uploaded?"
# git push --tags
clean:
find . -name "*.pyc" -delete
find . -name "*.sw*" -delete
find . -name "__pycache__" -delete
rm -rf $(LIBPATH)
.PHONY: test clean