-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (55 loc) · 1.85 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
59
60
61
62
63
64
65
66
67
68
69
70
.PHONY: help
export PYTHONPATH=$(shell pwd)
help: ## Prints out help dialog
@IFS=$$'\n' ; \
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//'`); \
for help_line in $${help_lines[@]}; do \
IFS=$$'#' ; \
help_split=($$help_line); \
help_command=`echo $${help_split[0]%%:*}`; \
help_info=`echo $${help_split[2]%%}`; \
printf "%-30s %s\n" $$help_command $$help_info; \
done; \
clean: clean-docs clean-build clean-pyc clean-test ## Remove build, Python, test artifacts, and docs
clean-build: ## Remove build artifacts (build, dist, .egg)
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean-docs: ## Remove docs
rm -f docs/py_golf_games.rst
rm -f docs/modules.rst
clean-pyc: ## Remove Python artifacts (.pyc, .pyo, __pycache__)
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 artifacts (.tox, .coverage, coveragexml)
@rm -fr .tox/
@rm -f .coverage
@rm -f coverage.xml
@rm -fr htmlcov/
coverage: ## Check code coverage with current Python
poetry run pytest --cov=py_golf_games
poetry run coverage report -m
poetry run coverage html
open htmlcov/index.html
docs: clean-docs ## generate Sphinx documentation
sphinx-apidoc -o docs/ py_golf_games
$(MAKE) -C docs clean
$(MAKE) -C docs html
open docs/_build/html/index.html
dist: clean ## Package py_golf_games
poetry build
ls -l dist
install: clean ## Install package to current Python's site-package
poetry install
lint: ## Check style with ruff
poetry run ruff check py_golf_games tests
release: clean ## Package and upload a release
ls -al
test: ## Runs test with current Python
poetry run pytest
test-all: ## Runs test against all Pythons with tox
tox