From e47e5a6e5c900e5dca8a655ceee1d42a75aa3dc9 Mon Sep 17 00:00:00 2001 From: Jack DeVries Date: Mon, 2 May 2022 17:58:35 -0400 Subject: [PATCH 1/4] create Makefile for faster iteration * makefile can automatically build the package, then navigate to the cpython repository to install the package and/or rebuild documentation --- CONTRIBUTING.rst | 9 +++++++++ Makefile | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 Makefile diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 8f5edaa..65d06ce 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -13,3 +13,12 @@ - bump version (YYYY.MM.dev) in setup.py and python_docs_theme/theme.conf - Commit this last bump. - push and push the tag (``git push && git push --tags``) + +# Makefile Usage + +This project includes a simple Makefile for syncing changes to the theme with +the main cpython repository. Run ``make help`` for details on available rules. + +There is one configurable variable, ``CPYTHON_ROOT``, which should be the path +to the cpython repository on your machine. By default, it points to +``../cpython``. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a14ff16 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +CPYTHON_ROOT = ../cpython +PACKAGE_ABS_PATH = $(shell pwd)/$(shell find dist/python-docs-theme-*.tar.gz) + + +.PHONY: all +all: install + cd $(CPYTHON_ROOT)/Doc && \ + make html + + +.PHONY: install +install: + python3 -m build + cd $(CPYTHON_ROOT)/Doc && \ + ./venv/bin/pip install $(PACKAGE_ABS_PATH) + +.PHONY: help +help: + @echo "all: run the \`\`\install\`\\ rule, and also rebuild the cpython docs" + @echo "install: build the package, and install it in the virtual environment" + @echo " at $(CPYTHON_ROOT)/Doc/venv" From da9de512b66931fed1e114714cd3a9b2349af5b1 Mon Sep 17 00:00:00 2001 From: Jack DeVries Date: Mon, 2 May 2022 19:57:35 -0400 Subject: [PATCH 2/4] rename `CPYTHON_ROOT` -> `CPYTHON_PATH` --- CONTRIBUTING.rst | 2 +- Makefile | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 65d06ce..38807d1 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -19,6 +19,6 @@ This project includes a simple Makefile for syncing changes to the theme with the main cpython repository. Run ``make help`` for details on available rules. -There is one configurable variable, ``CPYTHON_ROOT``, which should be the path +There is one configurable variable, ``CPYTHON_PATH``, which should be the path to the cpython repository on your machine. By default, it points to ``../cpython``. diff --git a/Makefile b/Makefile index a14ff16..c5e9702 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,21 @@ -CPYTHON_ROOT = ../cpython +CPYTHON_PATH = ../cpython PACKAGE_ABS_PATH = $(shell pwd)/$(shell find dist/python-docs-theme-*.tar.gz) .PHONY: all all: install - cd $(CPYTHON_ROOT)/Doc && \ + cd $(CPYTHON_PATH)/Doc && \ make html .PHONY: install install: python3 -m build - cd $(CPYTHON_ROOT)/Doc && \ + cd $(CPYTHON_PATH)/Doc && \ ./venv/bin/pip install $(PACKAGE_ABS_PATH) .PHONY: help help: @echo "all: run the \`\`\install\`\\ rule, and also rebuild the cpython docs" @echo "install: build the package, and install it in the virtual environment" - @echo " at $(CPYTHON_ROOT)/Doc/venv" + @echo " at $(CPYTHON_PATH)/Doc/venv" From fb7f510c09831d8a61b775ce5b648c426839ba22 Mon Sep 17 00:00:00 2001 From: Jack DeVries Date: Mon, 2 May 2022 20:03:05 -0400 Subject: [PATCH 3/4] revise help text --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c5e9702..a7cf07a 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,6 @@ install: .PHONY: help help: - @echo "all: run the \`\`\install\`\\ rule, and also rebuild the cpython docs" - @echo "install: build the package, and install it in the virtual environment" - @echo " at $(CPYTHON_PATH)/Doc/venv" + @echo "all: default rule; run the \`install\` rule, and also rebuild the cpython docs" + @echo "install: build the package, and install it into the virtual environment" + @echo " at $(CPYTHON_PATH)/Doc/venv" From b52b8cf68741b3cd55a699c5c8402d0e1e56923b Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 7 Feb 2023 00:44:34 +0200 Subject: [PATCH 4/4] Apply suggestions from code review --- CONTRIBUTING.rst | 6 +++--- Makefile | 17 +++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 38807d1..b313093 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -14,11 +14,11 @@ - Commit this last bump. - push and push the tag (``git push && git push --tags``) -# Makefile Usage +# Makefile usage This project includes a simple Makefile for syncing changes to the theme with -the main cpython repository. Run ``make help`` for details on available rules. +the main CPython repository. Run ``make help`` for details on available rules. There is one configurable variable, ``CPYTHON_PATH``, which should be the path -to the cpython repository on your machine. By default, it points to +to the CPython repository on your machine. By default, it points to ``../cpython``. diff --git a/Makefile b/Makefile index a7cf07a..7cde7e9 100644 --- a/Makefile +++ b/Makefile @@ -2,20 +2,21 @@ CPYTHON_PATH = ../cpython PACKAGE_ABS_PATH = $(shell pwd)/$(shell find dist/python-docs-theme-*.tar.gz) -.PHONY: all -all: install +.PHONY: html +html: venv cd $(CPYTHON_PATH)/Doc && \ make html -.PHONY: install -install: +.PHONY: venv +venv: python3 -m build - cd $(CPYTHON_PATH)/Doc && \ - ./venv/bin/pip install $(PACKAGE_ABS_PATH) + cd $(CPYTHON_PATH)/Doc \ + && make venv \ + && ./venv/bin/pip install $(PACKAGE_ABS_PATH) .PHONY: help help: - @echo "all: default rule; run the \`install\` rule, and also rebuild the cpython docs" - @echo "install: build the package, and install it into the virtual environment" + @echo "html: default rule; run the \`venv\` rule, and also rebuild the CPython docs" + @echo "venv: build the package, and install it into the virtual environment" @echo " at $(CPYTHON_PATH)/Doc/venv"