Debian Codegraph @

Makefile

raw symbols SCIP
1 .PHONY: clean clean-test clean-pyc clean-build docs help
2 .DEFAULT_GOAL := help
3
4 define BROWSER_PYSCRIPT
5 import os, webbrowser, sys
6
7 from urllib.request import pathname2url
8
9 webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
10 endef
11 export BROWSER_PYSCRIPT
12
13 define PRINT_HELP_PYSCRIPT
14 import re, sys
15
16 for line in sys.stdin:
17 match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
18 if match:
19 target, help = match.groups()
20 print("%-20s %s" % (target, help))
21 endef
22 export PRINT_HELP_PYSCRIPT
23
24 BROWSER := python -c "$$BROWSER_PYSCRIPT"
25
26 help:
27 @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
28
29 clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
30
31 clean-build: ## remove build artifacts
32 rm -fr build/
33 rm -fr dist/
34 rm -fr .eggs/
35 find . -name '*.egg-info' -exec rm -fr {} +
36 find . -name '*.egg' -exec rm -f {} +
37
38 clean-pyc: ## remove Python file artifacts
39 find . -name '*.pyc' -exec rm -f {} +
40 find . -name '*.pyo' -exec rm -f {} +
41 find . -name '*~' -exec rm -f {} +
42 find . -name '__pycache__' -exec rm -fr {} +
43
44 clean-test: ## remove test and coverage artifacts
45 rm -fr .tox/
46 rm -f .coverage
47 rm -fr htmlcov/
48 rm -fr .pytest_cache
49
50 lint: ## check style with flake8
51 flake8 blebox_uniapi tests
52
53 test: ## run tests quickly with the default Python
54 pytest -s
55
56 test-all: ## run tests on every Python version with tox
57 tox
58
59 coverage: ## check code coverage quickly with the default Python
60 coverage run --source blebox_uniapi -m pytest
61 coverage report -m
62 coverage html
63 $(BROWSER) htmlcov/index.html
64
65 docs: ## generate Sphinx HTML documentation, including API docs
66 rm -f docs/blebox_uniapi.rst
67 rm -f docs/modules.rst
68 sphinx-apidoc -o docs/ blebox_uniapi
69 $(MAKE) -C docs clean
70 $(MAKE) -C docs html
71 $(BROWSER) docs/_build/html/index.html
72
73 servedocs: docs ## compile the docs watching for changes
74 watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
75
76 release: dist ## package and upload a release
77 twine upload dist/*
78
79 dist: clean ## builds source and wheel package
80 python setup.py sdist
81 python setup.py bdist_wheel
82 ls -l dist
83
84 install: clean ## install the package to the active Python's site-packages
85 python setup.py install