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 --ignore=F401,E501 orsopy tests
52
53 test: ## run tests quickly with the default Python
54 pytest
55
56 coverage: ## check code coverage quickly with the default Python
57 coverage run --source orsopy -m pytest
58 coverage report -m
59 coverage html
60 $(BROWSER) htmlcov/index.html
61
62 docs: ## generate Sphinx HTML documentation, including API docs
63 $(MAKE) -C docs clean
64 $(MAKE) -C docs html
65 $(BROWSER) docs/_build/html/index.html
66
67 servedocs: docs ## compile the docs watching for changes
68 watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
69
70 release: dist ## package and upload a release
71 twine upload dist/*
72
73 dist: clean ## builds source and wheel package
74 python setup.py sdist
75 python setup.py bdist_wheel
76 ls -l dist
77
78 install: clean ## install the package to the active Python's site-packages
79 python setup.py install