-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathMakefile
More file actions
104 lines (79 loc) · 3.01 KB
/
Makefile
File metadata and controls
104 lines (79 loc) · 3.01 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Configuration
APP_ROOT := $(abspath $(lastword $(MAKEFILE_LIST))/..)
# end of configuration
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
else:
match = re.match(r'^## (.*)$$', line)
if match:
help = match.groups()[0]
print("\n%s" % (help))
endef
export PRINT_HELP_PYSCRIPT
.DEFAULT_GOAL := help
help: ## print this help message. (Default)
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
## Build targets:
install: ## install pywps
@echo "Installing pywps ..."
@-bash -c 'pip install -e .'
develop: ## install pywps with development libraries
@echo "Installing development requirements for tests and docs ..."
@-bash -c 'pip install -e ".[dev]"'
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
clean-build: ## remove build artifacts
@echo "Removing build artifacts ..."
@-rm -fr build/
@-rm -fr dist/
@-rm -fr .eggs/
@-find . -name '*.egg-info' -exec rm -fr {} +
@-find . -name '*.egg' -exec rm -f {} +
@-find . -name '*.log' -exec rm -fr {} +
@-find . -name '*.sqlite' -exec rm -fr {} +
clean-pyc: ## remove Python file artifacts
@echo "Removing Python file artifacts ..."
@-find . -name '*.pyc' -exec rm -f {} +
@-find . -name '*.pyo' -exec rm -f {} +
@-find . -name '*~' -exec rm -f {} +
@-find . -name '__pycache__' -exec rm -fr {} +
clean-test: ## remove test and coverage artifacts
@echo "Removing test artifacts ..."
@-rm -fr .tox/
@-rm -f .coverage
@-rm -fr .pytest_cache
clean-dist: clean ## remove git ignored files and directories
@echo "Running 'git clean' ..."
@git diff --quiet HEAD || echo "There are uncommitted changes! Aborting 'git clean' ..."
## do not use git clean -e/--exclude here, add them to .gitignore instead
@-git clean -dfx
clean-docs: ## remove documentation artifacts
@echo "Removing documentation artifacts ..."
$(MAKE) -C docs clean
lint: ## check style with ruff
@echo "Running code style checks ..."
@bash -c 'ruff check pywps'
## Testing targets:
test: ## run tests quickly with the default Python (skip slow and online tests)
@echo "Running tests (skip slow and online tests) ..."
@bash -c 'pytest -v -m "not slow and not online" tests/'
test-all: ## run all tests quickly with the default Python
@echo "Running all tests (including slow and online tests) ..."
@bash -c 'pytest -v tests/'
## Sphinx targets:
docs: clean-docs ## generate Sphinx HTML documentation, including API docs
@echo "Generating docs with Sphinx ..."
$(MAKE) -C docs html
@echo "Open your browser to: file:/$(APP_ROOT)/docs/build/html/index.html"
## do not execute xdg-open automatically since it hangs ReadTheDocs and job does not complete
@echo "xdg-open $(APP_ROOT)/docs/build/html/index.html"
## Deployment targets:
# dist: clean ## builds source and wheel package
# python -m flit build
# ls -l dist
# release: dist ## package and upload a release
# python -m flit publish dist/*