-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
47 lines (37 loc) · 1.07 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
.PHONY: lint test clean coverage docs build publish
# See setup.cfg for flake8 and mypy for options
lint:
python -m black ./iso8583 ./tests
python -m flake8
python -m mypy
# See pyproject.toml for pytest options
test: lint
python -m pytest
clean:
$(MAKE) coverage-clean
$(MAKE) build-clean
# Generage and publish code coverage reports
# See pyproject.toml coverage for options
coverage-clean:
rm --force --recursive .coverage
rm --force --recursive ./htmlcov
rm --force --recursive coverage.xml
coverage: coverage-clean
python -m pytest --cov=./iso8583
python -m coverage html --directory ./htmlcov
# Generate sphinx docs in docs/_build/html/index.html
docs:
$(MAKE) -C docs clean
$(MAKE) -C docs html
# Build and upload release to PyPI
build-clean:
rm --force --recursive dist/
rm --force --recursive build/
rm --force --recursive *.egg-info
build: build-clean
python ./setup.py sdist bdist_wheel
python -m twine check dist/*
publish: build
python -m twine upload dist/*
publish-test: build
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*