Skip to content

Commit

Permalink
Infra: Update Makefileto match CPython/Docs and devguide (#3985)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Sep 21, 2024
1 parent ab9258d commit e7d5f07
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,9 @@ html: venv
htmlview: html
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('build/index.html'))"

.PHONY: ensure-sphinx-autobuild
ensure-sphinx-autobuild: venv
$(call ensure_package,sphinx-autobuild)

## htmllive to rebuild and reload HTML files in your browser
.PHONY: htmllive
htmllive: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild
htmllive: SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-autobuild
# Arbitrarily selected ephemeral port between 49152–65535
# to avoid conflicts with other processes:
htmllive: SPHINXERRORHANDLING = --re-ignore="/\.idea/|/venv/|/pep-0000.rst|/topic/" --open-browser --delay 0 --port 55302
Expand All @@ -53,7 +49,7 @@ linkcheck: html
## clean to remove the venv and build files
.PHONY: clean
clean: clean-venv
-rm -rf build topic
-rm -rf $(BUILDDIR)

## clean-venv to remove the venv
.PHONY: clean-venv
Expand Down Expand Up @@ -89,11 +85,11 @@ _ensure-package: venv

.PHONY: _ensure-pre-commit
_ensure-pre-commit:
make _ensure-package PACKAGE=pre-commit
$(MAKE) _ensure-package PACKAGE=pre-commit

.PHONY: _ensure-sphinx-autobuild
_ensure-sphinx-autobuild:
make _ensure-package PACKAGE=sphinx-autobuild
$(MAKE) _ensure-package PACKAGE=sphinx-autobuild

## lint to lint all the files
.PHONY: lint
Expand All @@ -107,8 +103,7 @@ test: venv

## spellcheck to check spelling
.PHONY: spellcheck
spellcheck: venv
$(call ensure_package,pre_commit)
spellcheck: _ensure-pre-commit
$(VENVDIR)/bin/python3 -m pre_commit run --all-files --hook-stage manual codespell

.PHONY: help
Expand Down

0 comments on commit e7d5f07

Please sign in to comment.