Files
sphinx/Makefile
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

81 lines
1.8 KiB
Makefile
Raw Normal View History

2018-06-20 19:11:20 +01:00
PYTHON ?= python3
2007-07-23 09:02:25 +00:00
.PHONY: all
all: format style-check type-check doclinter test
2007-07-23 09:02:25 +00:00
2024-03-19 09:34:34 +01:00
.PHONY: check
check: style-check type-check doclinter
.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 {} +
find . -name __pycache__ -exec rm -rf {} +
2023-05-13 01:14:04 +01:00
# clean backup files:
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 {} +
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:
2023-05-13 01:14:04 +01:00
rm -rf doc/build/
rm -rf doc/_build/
2023-05-13 01:14:04 +01:00
rm -rf build/sphinx/
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
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 {} +
rm -f tests/test-server.lock
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:
@echo '[+] running ruff' ; ruff check .
2018-02-12 11:48:33 +00:00
.PHONY: format
format:
@ruff format .
2018-02-12 11:48:33 +00:00
.PHONY: type-check
type-check:
@mypy
2018-02-12 11:48:33 +00:00
2019-05-30 01:07:03 +09:00
.PHONY: doclinter
doclinter:
2024-03-21 13:12:06 +01: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-30 01:07:03 +09: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
.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)
.PHONY: build
build:
2022-04-16 21:38:39 +01:00
@$(PYTHON) -m build .
.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`.)
endif
2018-02-12 11:45:37 +00:00
$(MAKE) -C doc $(target)