2018-06-20 19:11:20 +01:00
|
|
|
PYTHON ?= python3
|
2007-07-23 09:02:25 +00:00
|
|
|
|
2017-10-04 20:22:34 +02:00
|
|
|
.PHONY: all
|
2023-05-13 01:14:04 +01:00
|
|
|
all: style-check type-check test
|
2007-07-23 09:02:25 +00:00
|
|
|
|
2017-10-04 20:22:34 +02:00
|
|
|
.PHONY: clean
|
2023-05-13 01:14:04 +01:00
|
|
|
clean: clean
|
|
|
|
|
# clean Python cache files:
|
2007-07-23 09:02:25 +00:00
|
|
|
find . -name '*.pyc' -exec rm -f {} +
|
|
|
|
|
find . -name '*.pyo' -exec rm -f {} +
|
2016-05-30 23:44:45 +09:00
|
|
|
find . -name __pycache__ -exec rm -rf {} +
|
|
|
|
|
|
2023-05-13 01:14:04 +01:00
|
|
|
# clean backup files:
|
2010-05-16 14:00:50 +02:00
|
|
|
find . -name '*~' -exec rm -f {} +
|
|
|
|
|
find . -name '*.bak' -exec rm -f {} +
|
2016-12-19 11:50:35 +09:00
|
|
|
find . -name '*.swp' -exec rm -f {} +
|
|
|
|
|
find . -name '*.swo' -exec rm -f {} +
|
2010-05-16 14:00:50 +02:00
|
|
|
|
2023-05-13 01:14:04 +01:00
|
|
|
# clean generated:
|
2016-12-19 11:50:35 +09:00
|
|
|
find . -name '.DS_Store' -exec rm -f {} +
|
2023-05-13 01:14:04 +01:00
|
|
|
|
|
|
|
|
# clean rendered documentation :
|
|
|
|
|
rm -rf doc/build/
|
2017-02-25 14:45:49 +09:00
|
|
|
rm -rf doc/_build/
|
2023-05-13 01:14:04 +01:00
|
|
|
rm -rf build/sphinx/
|
2010-05-16 22:19:38 +02:00
|
|
|
|
2023-05-13 01:14:04 +01:00
|
|
|
# clean caches:
|
|
|
|
|
find . -name '.mypy_cache' -exec rm -rf {} +
|
|
|
|
|
find . -name '.ruff_cache' -exec rm -rf {} +
|
|
|
|
|
|
|
|
|
|
# clean test files:
|
2016-12-19 11:50:35 +09:00
|
|
|
rm -rf tests/.coverage
|
2016-05-30 23:44:45 +09:00
|
|
|
rm -rf tests/build
|
|
|
|
|
rm -rf .tox/
|
2017-01-07 20:37:01 +09:00
|
|
|
rm -rf .cache/
|
2023-05-13 01:14:04 +01:00
|
|
|
find . -name '.pytest_cache' -exec rm -rf {} +
|
2016-05-30 23:44:45 +09:00
|
|
|
|
2023-05-13 01:14:04 +01:00
|
|
|
# clean build files:
|
|
|
|
|
rm -rf dist/
|
|
|
|
|
rm -rf build/
|
2016-12-13 23:59:01 +09:00
|
|
|
|
2018-02-12 11:48:33 +00:00
|
|
|
.PHONY: style-check
|
|
|
|
|
style-check:
|
|
|
|
|
@flake8
|
|
|
|
|
|
|
|
|
|
.PHONY: type-check
|
|
|
|
|
type-check:
|
2018-11-28 02:02:53 +09:00
|
|
|
mypy sphinx
|
2018-02-12 11:48:33 +00:00
|
|
|
|
2019-05-30 01:07:03 +09:00
|
|
|
.PHONY: doclinter
|
|
|
|
|
doclinter:
|
2022-06-16 20:32:09 +02:00
|
|
|
sphinx-lint --enable line-too-long --max-line-length 85 CHANGES *.rst doc/
|
2019-05-30 01:07:03 +09:00
|
|
|
|
2017-10-04 20:22:34 +02:00
|
|
|
.PHONY: test
|
2014-09-21 17:17:02 +02:00
|
|
|
test:
|
2022-04-16 19:13:34 +01:00
|
|
|
@$(PYTHON) -X dev -X warn_default_encoding -m pytest -v $(TEST)
|
2015-11-10 04:09:05 +01:00
|
|
|
|
2017-10-04 20:22:34 +02:00
|
|
|
.PHONY: covertest
|
2014-09-21 17:17:02 +02:00
|
|
|
covertest:
|
2022-04-16 19:13:34 +01:00
|
|
|
@$(PYTHON) -X dev -X warn_default_encoding -m pytest -v --cov=sphinx --junitxml=.junit.xml $(TEST)
|
2010-05-16 16:54:15 +02:00
|
|
|
|
2017-10-04 20:22:34 +02:00
|
|
|
.PHONY: build
|
2010-05-16 16:54:15 +02:00
|
|
|
build:
|
2022-04-16 21:38:39 +01:00
|
|
|
@$(PYTHON) -m build .
|
2017-10-04 20:31:50 +02:00
|
|
|
|
|
|
|
|
.PHONY: docs
|
|
|
|
|
docs:
|
|
|
|
|
ifndef target
|
2020-06-30 03:06:11 +02:00
|
|
|
$(info You need to provide a target variable, e.g. `make docs target=html`.)
|
2017-10-04 20:31:50 +02:00
|
|
|
endif
|
2018-02-12 11:45:37 +00:00
|
|
|
$(MAKE) -C doc $(target)
|