/
Makefile
58 lines (44 loc) · 1.57 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
.PHONY: install
install: ## Install package in editable mode with all the dependencies
pip install -e .
.PHONY: test
test: ## Run all tests
python setup.py test
.PHONY: lint
lint: ## Check linting according to the flake8 configuration in setup.cfg
flake8 .
.PHONY: mypy
mypy: ## Run typeckecking according to mypy configuration in setup.cfg
mypy .
.PHONY: build_docs
build_docs: ## Build the documentation
$(MAKE) -C doc html
.PHONY: build_latex
build_latex: ## Build the documentation into a pdf
$(MAKE) -C doc latexpdf
.PHONY: clean_docs
clean_docs: ## Clean the documentation build
$(MAKE) -C doc clean
rm -r doc/source/api
.PHONY: build_pypi
build_pypi: ## Build the Python package
python setup.py sdist bdist_wheel
.PHONY: push_pypi_test
push_pypi_test: ## Upload the Python package to the test PyPI registry
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
.PHONY: push_pypi
push_pypi: ## Upload the Python package to the PyPI registry
twine upload dist/*
.PHONY: help
help: ## Print out help message on using these commands
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: licenses
licenses:
# create a tox environment and pull in license information
tox --recreate -e licenses
cut -d, -f1,3 ./licenses/license_info.csv \
> ./licenses/license_info.no_versions.csv
.PHONY: check_licenses
# check if there has been a change in license information, used in CI
check_licenses:
git --no-pager diff --exit-code ./licenses/license_info.no_versions.csv