-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
46 lines (36 loc) · 1.06 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
.PHONY: lint test clean coverage build publish
# See setup.cfg for flake8 and mypy for options
lint:
python -m black ./pyemv ./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=./pyemv
python -m coverage html --directory ./htmlcov
python -m coverage xml -o coverage.xml
coverage-publish: coverage
codecov -f coverage.xml -t $(TOKEN)
# 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/*