-
Notifications
You must be signed in to change notification settings - Fork 59
/
Makefile
69 lines (53 loc) · 1.96 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.DEFAULT_GOAL := help
.PHONY: clean-build clean-pyc install-virtualenv-hooks
PWD = $(shell pwd)
define bold-yellow-echo
@tput bold
@tput setaf 3
@echo $1
@tput sgr0
endef
# Generates a help message. Borrowed from https://github.com/pydanny/cookiecutter-djangopackage.
help: ## Display this help message
@echo "Please use \`make <target>' where <target> is one of the following:"
@perl -nle'print $& if m{^[\.a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}'
install-develop: ## Install project into sandbox.
pip install --use-pep517 --prefer-binary --editable=.[develop,docs,test]
clean: clean-build clean-pyc
clean-build:
rm -fr build/
rm -fr dist/
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
check: lint test ## Run linter and software tests
check-ci: lint test-ci ## Run linter and software tests on CI
lint: ## lint the project
ruff check .
black --check .
format: ## Run code formatting
# Configure Ruff not to auto-fix (remove!):
# Ignore unused imports (F401), unused variables (F841), `print` statements (T201), and commented-out code (ERA001).
ruff --fix --ignore=ERA --ignore=F401 --ignore=F841 --ignore=T20 --ignore=ERA001 .
black .
test: clean ## Run tests with virtualenv Python
pytest --lf
test-ci: clean ## Run tests in CI environment with virtualenv Python
pytest
coverage: clean test-ci ## Check code coverage locally
coverage html
open htmlcov/index.html
release: clean # Package and upload a release to PyPI
python -m build
twine check dist/*
twine upload --repository pypi dist/*
open https://pypi.org/project/python-epo-ops-client/
release-test: clean # Package and upload a release to testpypi
python -m build
twine check dist/*
twine upload --repository testpypi dist/*
open https://test.pypi.org/project/python-epo-ops-client/
sdist: clean
python setup.py sdist
ls -l dist