sphinx/Makefile

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

82 lines
1.8 KiB
Makefile
Raw Normal View History

PYTHON ?= python3
2007-07-23 04:02:25 -05:00
.PHONY: all
all: format style-check type-check doclinter test
2007-07-23 04:02:25 -05:00
.PHONY: check
check: style-check type-check doclinter
.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 {} +
find . -name __pycache__ -exec rm -rf {} +
2023-05-12 19:14:04 -05:00
# clean backup files:
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 {} +
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
# clean rendered documentation:
2023-05-12 19:14:04 -05:00
rm -rf doc/build/
rm -rf doc/_build/
2023-05-12 19:14:04 -05:00
rm -rf build/sphinx/
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
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 {} +
rm -f tests/test-server.lock
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
.PHONY: style-check
style-check:
@echo '[+] running ruff' ; ruff check .
.PHONY: format
format:
@ruff format .
.PHONY: type-check
type-check:
@mypy
2019-05-29 11:07:03 -05:00
.PHONY: doclinter
doclinter:
@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
.PHONY: test
test:
@$(PYTHON) -X dev -X warn_default_encoding -m pytest -v $(TEST)
.PHONY: covertest
covertest:
@$(PYTHON) -X dev -X warn_default_encoding -m pytest -v --cov=sphinx --junitxml=.junit.xml $(TEST)
.PHONY: build
build:
@$(PYTHON) -m build .
.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`.)
endif
$(MAKE) -C doc $(target)