Debian Codegraph @

Makefile

raw
1 .PHONY: clean-pyc clean-build docs help
2 .DEFAULT_GOAL := help
3 define BROWSER_PYSCRIPT
4 import os, webbrowser, sys
5 try:
6 from urllib import pathname2url
7 except:
8 from urllib.request import pathname2url
9
10 webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
11 endef
12 export BROWSER_PYSCRIPT
13 BROWSER := python -c "$$BROWSER_PYSCRIPT"
14
15 help:
16 @perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}'
17
18 clean: clean-build clean-pyc
19
20 clean-build: ## remove build artifacts
21 rm -fr build/
22 rm -fr dist/
23 rm -fr *.egg-info
24
25 clean-pyc: ## remove Python file artifacts
26 find . -name '*.pyc' -exec rm -f {} +
27 find . -name '*.pyo' -exec rm -f {} +
28 find . -name '*~' -exec rm -f {} +
29
30 lint: ## check style with flake8
31 flake8 django_json_widget tests
32
33 test: ## run tests quickly with the default Python
34 python runtests.py tests
35
36 test-all: ## run tests on every Python version with tox
37 tox
38
39 coverage: ## check code coverage quickly with the default Python
40 coverage run --source django_json_widget runtests.py tests
41 coverage report -m
42 coverage html
43 open htmlcov/index.html
44
45 docs: ## generate Sphinx HTML documentation, including API docs
46 rm -f docs/django-json-widget.rst
47 rm -f docs/modules.rst
48 sphinx-apidoc -o docs/ django_json_widget
49 $(MAKE) -C docs clean
50 $(MAKE) -C docs html
51 $(BROWSER) docs/_build/html/index.html
52
53 release: clean ## package and upload a release
54 python -m build
55 twine upload dist/*
56
57 test-release: clean ## package and upload a release to test PyPI
58 python -m build
59 twine upload --repository testpypi dist/*
60
61 sdist: clean ## package
62 python -m build --sdist
63 ls -l dist
64
65 twine-release: ## upload release to pypi
66 twine upload dist/*