-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
44 lines (35 loc) · 1.24 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
# vim:set noexpandtab :
.PHONY: help test install lint format
CURRENT_DIRECTORY=$(shell pwd)
VIRTUAL_ENV?=$(CURRENT_DIRECTORY)/venv
PIP?=${VIRTUAL_ENV}/bin/pip
PYTHON?=${VIRTUAL_ENV}/bin/python
BLACK?=${VIRTUAL_ENV}/bin/black
ISORT?=${VIRTUAL_ENV}/bin/isort
PYTEST=${VIRTUAL_ENV}/bin/pytest
.DEFAULT: help
help:
@echo "make test"
@echo " run tests"
@echo "make lint"
@echo " run black"
test: lint
PYTHONPATH=$(CURRENT_DIRECTORY) ${PYTHON} -m pytest --cov=staxapp --cov-config=.coveragerc --cov-report term-missing tests/ --junitxml=coverage-reports/test-report.xml --cov-report xml:coverage-reports/coverage-report.xml
install:
python3 -m venv ${VIRTUAL_ENV}
${PIP} install -r requirements.txt
${PYTHON} setup.py install
lint: install
${ISORT} --diff staxapp/*.py
${BLACK} -t py37 --check --diff staxapp/
format:
${ISORT} --apply staxapp/*.py
${BLACK} -t py37 staxapp/*.py
${BLACK} -t py37 staxapp/data/*.json
download-schema:
curl --fail --compressed -s -o staxapp/data/schema.json https://api.au1.staxapp.cloud/20190206/public/api-document
bundle-test: install
${PIP} install twine
${PYTHON} setup.py sdist
${VIRTUAL_ENV}/bin/twine check dist/*
${VIRTUAL_ENV}/bin/twine upload --repository-url https://test.pypi.org/legacy/ dist/*