2018-06-20 13:11:20 -05:00
|
|
|
PYTHON ?= python3
|
2007-07-23 04:02:25 -05:00
|
|
|
|
2017-10-04 13:22:34 -05:00
|
|
|
.PHONY: all
|
2024-03-19 04:27:41 -05:00
|
|
|
all: format style-check type-check doclinter test
|
2007-07-23 04:02:25 -05:00
|
|
|
|
2024-03-19 03:34:34 -05:00
|
|
|
.PHONY: check
|
|
|
|
check: style-check type-check doclinter
|
|
|
|
|
2017-10-04 13:22:34 -05:00
|
|
|
.PHONY: clean
|
2023-05-12 19:14:04 -05:00
|
|
|
clean: clean
|
|
|
|
# clean Python cache files:
|
2007-07-23 04:02:25 -05:00
|
|
|
find . -name '*.pyc' -exec rm -f {} +
|
|
|
|
find . -name '*.pyo' -exec rm -f {} +
|
2016-05-30 09:44:45 -05:00
|
|
|
find . -name __pycache__ -exec rm -rf {} +
|
|
|
|
|
2023-05-12 19:14:04 -05:00
|
|
|
# clean backup files:
|
2010-05-16 07:00:50 -05:00
|
|
|
find . -name '*~' -exec rm -f {} +
|
|
|
|
find . -name '*.bak' -exec rm -f {} +
|
2016-12-18 20:50:35 -06:00
|
|
|
find . -name '*.swp' -exec rm -f {} +
|
|
|
|
find . -name '*.swo' -exec rm -f {} +
|
2010-05-16 07:00:50 -05:00
|
|
|
|
2023-05-12 19:14:04 -05:00
|
|
|
# clean generated:
|
2016-12-18 20:50:35 -06:00
|
|
|
find . -name '.DS_Store' -exec rm -f {} +
|
2023-05-12 19:14:04 -05:00
|
|
|
|
2024-03-17 08:45:56 -05:00
|
|
|
# clean rendered documentation:
|
2023-05-12 19:14:04 -05:00
|
|
|
rm -rf doc/build/
|
2017-02-24 23:45:49 -06:00
|
|
|
rm -rf doc/_build/
|
2023-05-12 19:14:04 -05:00
|
|
|
rm -rf build/sphinx/
|
2010-05-16 15:19:38 -05:00
|
|
|
|
2023-05-12 19:14:04 -05:00
|
|
|
# clean caches:
|
|
|
|
find . -name '.mypy_cache' -exec rm -rf {} +
|
|
|
|
find . -name '.ruff_cache' -exec rm -rf {} +
|
|
|
|
|
|
|
|
# clean test files:
|
2016-12-18 20:50:35 -06:00
|
|
|
rm -rf tests/.coverage
|
2016-05-30 09:44:45 -05:00
|
|
|
rm -rf tests/build
|
|
|
|
rm -rf .tox/
|
2017-01-07 05:37:01 -06:00
|
|
|
rm -rf .cache/
|
2023-05-12 19:14:04 -05:00
|
|
|
find . -name '.pytest_cache' -exec rm -rf {} +
|
2024-03-17 08:45:56 -05:00
|
|
|
rm -f tests/test-server.lock
|
2016-05-30 09:44:45 -05:00
|
|
|
|
2023-05-12 19:14:04 -05:00
|
|
|
# clean build files:
|
|
|
|
rm -rf dist/
|
|
|
|
rm -rf build/
|
2016-12-13 08:59:01 -06:00
|
|
|
|
2018-02-12 05:48:33 -06:00
|
|
|
.PHONY: style-check
|
|
|
|
style-check:
|
2024-03-25 05:39:05 -05:00
|
|
|
@echo '[+] running ruff' ; ruff check .
|
2018-02-12 05:48:33 -06:00
|
|
|
|
2024-03-19 04:27:41 -05:00
|
|
|
.PHONY: format
|
|
|
|
format:
|
|
|
|
@ruff format .
|
|
|
|
|
2018-02-12 05:48:33 -06:00
|
|
|
.PHONY: type-check
|
|
|
|
type-check:
|
2024-03-17 08:45:56 -05:00
|
|
|
@mypy
|
2018-02-12 05:48:33 -06:00
|
|
|
|
2019-05-29 11:07:03 -05:00
|
|
|
.PHONY: doclinter
|
|
|
|
doclinter:
|
2024-03-21 07:12:06 -05:00
|
|
|
@sphinx-lint --enable all --disable triple-backticks --max-line-length 85 --sort-by filename,line \
|
|
|
|
$(addprefix -i doc/, _build _static _templates _themes) \
|
|
|
|
AUTHORS.rst CHANGES.rst CODE_OF_CONDUCT.rst CONTRIBUTING.rst README.rst doc/
|
2019-05-29 11:07:03 -05:00
|
|
|
|
2017-10-04 13:22:34 -05:00
|
|
|
.PHONY: test
|
2014-09-21 10:17:02 -05:00
|
|
|
test:
|
2022-04-16 13:13:34 -05:00
|
|
|
@$(PYTHON) -X dev -X warn_default_encoding -m pytest -v $(TEST)
|
2015-11-09 21:09:05 -06:00
|
|
|
|
2017-10-04 13:22:34 -05:00
|
|
|
.PHONY: covertest
|
2014-09-21 10:17:02 -05:00
|
|
|
covertest:
|
2022-04-16 13:13:34 -05:00
|
|
|
@$(PYTHON) -X dev -X warn_default_encoding -m pytest -v --cov=sphinx --junitxml=.junit.xml $(TEST)
|
2010-05-16 09:54:15 -05:00
|
|
|
|
2017-10-04 13:22:34 -05:00
|
|
|
.PHONY: build
|
2010-05-16 09:54:15 -05:00
|
|
|
build:
|
2022-04-16 15:38:39 -05:00
|
|
|
@$(PYTHON) -m build .
|
2017-10-04 13:31:50 -05:00
|
|
|
|
|
|
|
.PHONY: docs
|
|
|
|
docs:
|
|
|
|
ifndef target
|
2020-06-29 20:06:11 -05:00
|
|
|
$(info You need to provide a target variable, e.g. `make docs target=html`.)
|
2017-10-04 13:31:50 -05:00
|
|
|
endif
|
2018-02-12 05:45:37 -06:00
|
|
|
$(MAKE) -C doc $(target)
|