From 8c849c83c2b8d1cef07c40b42624f542671096a1 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:14:31 +0100 Subject: [PATCH 1/4] Doc: Use the Snowball project's PyStemmer library PyStemmer exposes bindings to libstemmer_c, the core Snowball library written in C. This can improve performance of word stemming. --- Doc/requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/requirements.txt b/Doc/requirements.txt index bf1028020b7af7..3d976ba73ff941 100644 --- a/Doc/requirements.txt +++ b/Doc/requirements.txt @@ -10,8 +10,10 @@ sphinx~=8.0.0 blurb +# Optional packages, used if installed sphinxext-opengraph~=0.9.0 sphinx-notfound-page~=1.0.0 +PyStemmer~=2.2.0 # The theme used by the documentation is stored separately, so we need # to install that as well. From c9d685c11807e09caf4955f8b1e2c3c5d1e2d75c Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:42:16 +0100 Subject: [PATCH 2/4] Don't use PyStemmer with doctest --- .github/workflows/reusable-docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/reusable-docs.yml b/.github/workflows/reusable-docs.yml index 3809f24dcc977e..3a0135067ddb7a 100644 --- a/.github/workflows/reusable-docs.yml +++ b/.github/workflows/reusable-docs.yml @@ -111,6 +111,8 @@ jobs: run: ./configure --with-pydebug - name: 'Build CPython' run: make -j4 + - name: 'Remove PyStemmer from requirements.txt' + run: sed -i '/PyStemmer.*/d' Doc/requirements.txt - name: 'Install build dependencies' run: make -C Doc/ PYTHON=../python venv # Use "xvfb-run" since some doctest tests open GUI windows From 551edb041f5341c264262c856ab146c5c8259a8d Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:32:29 +0100 Subject: [PATCH 3/4] try --only-binary --- .github/workflows/reusable-docs.yml | 2 -- Doc/Makefile | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reusable-docs.yml b/.github/workflows/reusable-docs.yml index 3a0135067ddb7a..3809f24dcc977e 100644 --- a/.github/workflows/reusable-docs.yml +++ b/.github/workflows/reusable-docs.yml @@ -111,8 +111,6 @@ jobs: run: ./configure --with-pydebug - name: 'Build CPython' run: make -j4 - - name: 'Remove PyStemmer from requirements.txt' - run: sed -i '/PyStemmer.*/d' Doc/requirements.txt - name: 'Install build dependencies' run: make -C Doc/ PYTHON=../python venv # Use "xvfb-run" since some doctest tests open GUI windows diff --git a/Doc/Makefile b/Doc/Makefile index a090ee5ba92705..4d653650019d60 100644 --- a/Doc/Makefile +++ b/Doc/Makefile @@ -173,11 +173,11 @@ venv: echo "Creating venv in $(VENVDIR)"; \ if $(UV) --version >/dev/null 2>&1; then \ $(UV) venv $(VENVDIR); \ - VIRTUAL_ENV=$(VENVDIR) $(UV) pip install -r $(REQUIREMENTS); \ + VIRTUAL_ENV=$(VENVDIR) $(UV) pip install -r $(REQUIREMENTS) --only-binary PyStemmer; \ else \ $(PYTHON) -m venv $(VENVDIR); \ $(VENVDIR)/bin/python3 -m pip install --upgrade pip; \ - $(VENVDIR)/bin/python3 -m pip install -r $(REQUIREMENTS); \ + $(VENVDIR)/bin/python3 -m pip install -r $(REQUIREMENTS) --only-binary PyStemmer; \ fi; \ echo "The venv has been created in the $(VENVDIR) directory"; \ fi From f1b1dc752be26bbec75d6fd02885802eaee719ee Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:41:56 +0100 Subject: [PATCH 4/4] Revert "try --only-binary" This reverts commit 551edb041f5341c264262c856ab146c5c8259a8d. --- .github/workflows/reusable-docs.yml | 2 ++ Doc/Makefile | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-docs.yml b/.github/workflows/reusable-docs.yml index 3809f24dcc977e..3a0135067ddb7a 100644 --- a/.github/workflows/reusable-docs.yml +++ b/.github/workflows/reusable-docs.yml @@ -111,6 +111,8 @@ jobs: run: ./configure --with-pydebug - name: 'Build CPython' run: make -j4 + - name: 'Remove PyStemmer from requirements.txt' + run: sed -i '/PyStemmer.*/d' Doc/requirements.txt - name: 'Install build dependencies' run: make -C Doc/ PYTHON=../python venv # Use "xvfb-run" since some doctest tests open GUI windows diff --git a/Doc/Makefile b/Doc/Makefile index 4d653650019d60..a090ee5ba92705 100644 --- a/Doc/Makefile +++ b/Doc/Makefile @@ -173,11 +173,11 @@ venv: echo "Creating venv in $(VENVDIR)"; \ if $(UV) --version >/dev/null 2>&1; then \ $(UV) venv $(VENVDIR); \ - VIRTUAL_ENV=$(VENVDIR) $(UV) pip install -r $(REQUIREMENTS) --only-binary PyStemmer; \ + 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) --only-binary PyStemmer; \ + $(VENVDIR)/bin/python3 -m pip install -r $(REQUIREMENTS); \ fi; \ echo "The venv has been created in the $(VENVDIR) directory"; \ fi