Skip to content

Commit

Permalink
Merge branch 'master' into latex_DUrole
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbu authored Aug 12, 2024
2 parents 824f0a4 + 03b9134 commit f8db515
Show file tree
Hide file tree
Showing 23 changed files with 366 additions and 187 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/builddoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ concurrency:

env:
FORCE_COLOR: "1"
UV_SYSTEM_PYTHON: "1" # make uv do global installs

jobs:
build:
Expand All @@ -27,10 +28,14 @@ jobs:
python-version: "3"
- name: Install graphviz
run: sudo apt-get install graphviz
- name: Install uv
run: >
curl --no-progress-meter --location --fail
--proto '=https' --tlsv1.2
"https://astral.sh/uv/install.sh"
| sh
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[docs]
run: uv pip install .[docs]
- name: Render the documentation
run: >
sphinx-build
Expand Down
57 changes: 35 additions & 22 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ concurrency:

env:
FORCE_COLOR: "1"
UV_SYSTEM_PYTHON: "1" # make uv do global installs

jobs:
# If you update any of these commands, don't forget to update the equivalent
Expand All @@ -23,17 +24,13 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install pip
run: python -m pip install --upgrade pip

- name: Install Ruff
run: |
ruff_version=$(awk -F'[="]' '/\[project\.optional-dependencies\]/ {p=1} /ruff/ {if (p) print $4}' pyproject.toml)
python -m pip install "ruff==${ruff_version}"
run: >
RUFF_VERSION=$(awk -F'[="]' '/\[project\.optional-dependencies\]/ {p=1} /ruff/ {if (p) print $4}' pyproject.toml)
curl --no-progress-meter --location --fail
--proto '=https' --tlsv1.2
"https://astral.sh/ruff/${RUFF_VERSION}/install.sh"
| sh
- name: Lint with Ruff
run: ruff check . --output-format github
Expand All @@ -50,10 +47,14 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install uv
run: >
curl --no-progress-meter --location --fail
--proto '=https' --tlsv1.2
"https://astral.sh/uv/install.sh"
| sh
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade "flake8>=6.0"
run: uv pip install --upgrade "flake8>=6.0"
- name: Lint with flake8
run: flake8 .

Expand All @@ -66,10 +67,14 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install uv
run: >
curl --no-progress-meter --location --fail
--proto '=https' --tlsv1.2
"https://astral.sh/uv/install.sh"
| sh
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[lint,test]"
run: uv pip install ".[lint,test]"
- name: Type check with mypy
run: mypy

Expand All @@ -82,10 +87,14 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install uv
run: >
curl --no-progress-meter --location --fail
--proto '=https' --tlsv1.2
"https://astral.sh/uv/install.sh"
| sh
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade sphinx-lint
run: uv pip install --upgrade sphinx-lint
- name: Lint documentation with sphinx-lint
run: make doclinter

Expand All @@ -98,10 +107,14 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install uv
run: >
curl --no-progress-meter --location --fail
--proto '=https' --tlsv1.2
"https://astral.sh/uv/install.sh"
| sh
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade twine build
run: uv pip install --upgrade twine build
- name: Lint with twine
run: |
python -m build .
Expand Down
94 changes: 69 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
- "3.13-dev"
docutils:
- "0.20"
- "0.21"
Expand All @@ -49,12 +48,43 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
if: "!endsWith(matrix.python, '-dev')"
with:
python-version: ${{ matrix.python }}
- name: Check Python version
run: python --version --version
- name: Install graphviz
run: sudo apt-get install graphviz
- name: Install uv
run: >
curl --no-progress-meter --location --fail
--proto '=https' --tlsv1.2
"https://astral.sh/uv/install.sh"
| sh
- name: Install dependencies
run: uv pip install .[test]
- name: Install Docutils ${{ matrix.docutils }}
run: uv pip install --upgrade "docutils~=${{ matrix.docutils }}.0"
- name: Test with pytest
run: python -m pytest -vv --durations 25
env:
PYTHONWARNINGS: "error" # treat all warnings as errors

deadsnakes:
runs-on: ubuntu-latest
name: Python ${{ matrix.python }} (Docutils ${{ matrix.docutils }})
strategy:
fail-fast: false
matrix:
python:
- "3.13-dev"
docutils:
- "0.20"
- "0.21"

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }} (deadsnakes)
uses: deadsnakes/[email protected]
if: "endsWith(matrix.python, '-dev')"
with:
python-version: ${{ matrix.python }}
- name: Check Python version
Expand Down Expand Up @@ -84,10 +114,14 @@ jobs:
python-version: "3"
- name: Check Python version
run: python --version --version
- name: Install graphviz
run: choco install --no-progress graphviz
- name: Install uv
run: >
Invoke-WebRequest -Uri "https://astral.sh/uv/install.ps1"
| Invoke-Expression
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
run: uv pip install .[test]
- name: Test with pytest
run: python -m pytest -vv --durations 25
env:
Expand All @@ -100,9 +134,10 @@ jobs:
steps:
- name: Install epubcheck
run: |
EPUBCHECK_VERSION="5.1.0"
mkdir /tmp/epubcheck && cd /tmp/epubcheck
wget https://github.com/w3c/epubcheck/releases/download/v5.1.0/epubcheck-5.1.0.zip
unzip epubcheck-5.1.0.zip
wget --no-verbose https://github.com/w3c/epubcheck/releases/download/v${EPUBCHECK_VERSION}/epubcheck-${EPUBCHECK_VERSION}.zip
unzip epubcheck-${EPUBCHECK_VERSION}.zip
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
Expand All @@ -112,12 +147,16 @@ jobs:
run: python --version --version
- name: Install graphviz
run: sudo apt-get install graphviz
- name: Install uv
run: >
curl --no-progress-meter --location --fail
--proto '=https' --tlsv1.2
"https://astral.sh/uv/install.sh"
| sh
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
run: uv pip install .[test]
- name: Install Docutils' HEAD
run: python -m pip install git+https://repo.or.cz/docutils.git\#subdirectory=docutils
run: uv pip install "docutils @ git+https://repo.or.cz/docutils.git#subdirectory=docutils"
- name: Test with pytest
run: python -m pytest -vv
env:
Expand All @@ -140,13 +179,10 @@ jobs:
- name: Install graphviz
run: sudo apt-get install graphviz
- name: Install uv
run: >
curl
--location
--fail
--proto '=https' --tlsv1.2
--silent --show-error
https://astral.sh/uv/install.sh
run: >
curl --no-progress-meter --location --fail
--proto '=https' --tlsv1.2
"https://astral.sh/uv/install.sh"
| sh
- name: Install dependencies
run: |
Expand All @@ -171,10 +207,14 @@ jobs:
python-version: "3"
- name: Check Python version
run: python --version --version
- name: Install uv
run: >
curl --no-progress-meter --location --fail
--proto '=https' --tlsv1.2
"https://astral.sh/uv/install.sh"
| sh
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
run: uv pip install .[test]
- name: Test with pytest
run: python -m pytest -vv --durations 25
env:
Expand All @@ -196,10 +236,14 @@ jobs:
run: python --version --version
- name: Install graphviz
run: sudo apt-get install graphviz
- name: Install uv
run: >
curl --no-progress-meter --location --fail
--proto '=https' --tlsv1.2
"https://astral.sh/uv/install.sh"
| sh
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test] pytest-cov
run: uv pip install .[test] pytest-cov
- name: Test with pytest
run: python -m pytest -vv --cov . --cov-append --cov-config pyproject.toml
env:
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ Bugs fixed
* #12744: Classes injected by a custom interpreted text role now give rise to
nested ``\DUrole``'s, rather than a single one with comma separated classes.
Patch by Jean-François B.
* #11970, #12551: singlehtml builder: make target URIs to be same-document
references in the sense of :rfc:`RFC 3986, §4.4 <3986#section-4.4>`,
e.g., ``index.html#foo`` becomes ``#foo``.
(note: continuation of a partial fix added in Sphinx 7.3.0)
Patch by James Addison (with reference to prior work by Eric Norige)

Testing
-------
Expand Down
3 changes: 2 additions & 1 deletion sphinx/builders/_epub_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
from docutils.utils import smartquotes

from sphinx import addnodes
from sphinx.builders.html import BuildInfo, StandaloneHTMLBuilder
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.builders.html._build_info import BuildInfo
from sphinx.locale import __
from sphinx.util import logging
from sphinx.util.display import status_iterator
Expand Down
Loading

0 comments on commit f8db515

Please sign in to comment.