https://github.com/python/cpython/commit/f5c39b3e9cc88d1eaa9229d610b0221305a83ad9
commit: f5c39b3e9cc88d1eaa9229d610b0221305a83ad9
branch: main
author: Libor MartĂ­nek <[email protected]>
committer: hugovk <[email protected]>
date: 2024-08-04T17:02:29+03:00
summary:

gh-122661: Remove GNU make-specific directive from Doc/Makefile (#122662)

files:
M Doc/Makefile

diff --git a/Doc/Makefile b/Doc/Makefile
index c70768754834dd..b2ee3fe7d28ed0 100644
--- a/Doc/Makefile
+++ b/Doc/Makefile
@@ -6,6 +6,7 @@
 # You can set these variables from the command line.
 PYTHON       = python3
 VENVDIR      = ./venv
+UV           = uv
 SPHINXBUILD  = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
 BLURB        = PATH=$(VENVDIR)/bin:$$PATH blurb
 JOBS         = auto
@@ -150,14 +151,10 @@ gettext: build
 htmlview: html
        $(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + 
os.path.realpath('build/html/index.html'))"
 
-.PHONY: ensure-sphinx-autobuild
-ensure-sphinx-autobuild: venv
-       $(call ensure_package,sphinx-autobuild)
-
 .PHONY: htmllive
 htmllive: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild
 htmllive: SPHINXOPTS = --re-ignore="/venv/" --open-browser --delay 0
-htmllive: ensure-sphinx-autobuild html
+htmllive: _ensure-sphinx-autobuild html
 
 .PHONY: clean
 clean: clean-venv
@@ -174,15 +171,15 @@ venv:
                echo "To recreate it, remove it first with \`make 
clean-venv'."; \
        else \
                echo "Creating venv in $(VENVDIR)"; \
-               if uv --version > /dev/null; then \
-                       uv venv $(VENVDIR); \
-                       VIRTUAL_ENV=$(VENVDIR) uv pip install -r 
$(REQUIREMENTS); \
+               if $(UV) --version >/dev/null 2>&1; then \
+                       $(UV) venv $(VENVDIR); \
+                       VIRTUAL_ENV=$(VENVDIR) $(UV) pip install -r 
$(REQUIREMENTS); \
                else \
                        $(PYTHON) -m venv $(VENVDIR); \
                        $(VENVDIR)/bin/python3 -m pip install --upgrade pip; \
                        $(VENVDIR)/bin/python3 -m pip install -r 
$(REQUIREMENTS); \
-                       echo "The venv has been created in the $(VENVDIR) 
directory"; \
                fi; \
+               echo "The venv has been created in the $(VENVDIR) directory"; \
        fi
 
 .PHONY: dist
@@ -240,17 +237,24 @@ dist:
        rm -r dist/python-$(DISTVERSION)-docs-texinfo
        rm dist/python-$(DISTVERSION)-docs-texinfo.tar
 
-define ensure_package
-       if uv --version > /dev/null; then \
-               $(VENVDIR)/bin/python3 -m $(1) --version > /dev/null || 
VIRTUAL_ENV=$(VENVDIR) uv pip install $(1); \
+.PHONY: _ensure-package
+_ensure-package: venv
+       if $(UV) --version >/dev/null 2>&1; then \
+               VIRTUAL_ENV=$(VENVDIR) $(UV) pip install $(PACKAGE); \
        else \
-               $(VENVDIR)/bin/python3 -m $(1) --version > /dev/null || 
$(VENVDIR)/bin/python3 -m pip install $(1); \
+               $(VENVDIR)/bin/python3 -m pip install $(PACKAGE); \
        fi
-endef
+
+.PHONY: _ensure-pre-commit
+_ensure-pre-commit:
+       make _ensure-package PACKAGE=pre-commit
+
+.PHONY: _ensure-sphinx-autobuild
+_ensure-sphinx-autobuild:
+       make _ensure-package PACKAGE=sphinx-autobuild
 
 .PHONY: check
-check: venv
-       $(call ensure_package,pre_commit)
+check: _ensure-pre-commit
        $(VENVDIR)/bin/python3 -m pre_commit run --all-files
 
 .PHONY: serve

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to