diff --git a/.github/workflows/builddoc.yml b/.github/workflows/builddoc.yml deleted file mode 100644 index 5c1736d3c5b..00000000000 --- a/.github/workflows/builddoc.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Render documentation - -on: - push: - pull_request: - workflow_dispatch: - -permissions: - contents: read - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -env: - FORCE_COLOR: "1" - UV_SYSTEM_PYTHON: "1" # make uv do global installs - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - 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: uv pip install .[docs] - - name: Render the documentation - run: > - sphinx-build - -M html ./doc ./build/sphinx - -vv - --jobs=auto - --show-traceback - --fail-on-warning diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 96a7ef718bd..00000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,146 +0,0 @@ -name: Lint source code - -on: - push: - pull_request: - workflow_dispatch: - -permissions: - contents: read - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -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 - # tox environment - ruff: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Get Ruff version from pyproject.toml - run: | - RUFF_VERSION=$(awk -F'[="]' '/\[project\.optional-dependencies\]/ {p=1} /ruff/ {if (p) print $4}' pyproject.toml) - echo "RUFF_VERSION=$RUFF_VERSION" >> $GITHUB_ENV - - - name: Install Ruff - run: > - curl --no-progress-meter --location --fail - --proto '=https' --tlsv1.2 - --write-out "%{stderr}Downloaded: %{url}\n" - "https://astral.sh/ruff/$RUFF_VERSION/install.sh" - | sh - - - name: Lint with Ruff - run: ruff check . --output-format github - - - name: Format with Ruff - run: ruff format . --diff - - flake8: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - 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: uv pip install --upgrade "flake8>=6.0" - - name: Lint with flake8 - run: flake8 . - - mypy: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - 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: uv pip install ".[lint,test]" - - name: Type check with mypy - run: mypy - - pyright: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - 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: uv pip install ".[lint,test]" - - name: Type check with pyright - run: pyright - - docs-lint: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - 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: uv pip install --upgrade sphinx-lint - - name: Lint documentation with sphinx-lint - run: make doclinter - - twine: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - 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: uv pip install --upgrade twine build - - name: Lint with twine - run: | - python -m build . - twine check dist/* diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml deleted file mode 100644 index d86f4b36282..00000000000 --- a/.github/workflows/lock.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Lock old threads - -on: - schedule: - - cron: "0 0 * * *" - -permissions: - issues: write - pull-requests: write - -jobs: - action: - if: github.repository_owner == 'sphinx-doc' - runs-on: ubuntu-latest - steps: - - uses: dessant/lock-threads@v3 - with: - github-token: ${{ github.token }} - issue-inactive-days: "30" - pr-inactive-days: "30" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index b38a8d70983..00000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,289 +0,0 @@ -name: CI - -on: - push: - paths: - - ".github/workflows/main.yml" - - "sphinx/**" - - "tests/**" - pull_request: - paths: - - ".github/workflows/main.yml" - - "sphinx/**" - - "tests/**" - -permissions: - contents: read - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -env: - FORCE_COLOR: "1" - PYTHONDEVMODE: "1" # -X dev - PYTHONWARNDEFAULTENCODING: "1" # -X warn_default_encoding - UV_SYSTEM_PYTHON: "1" # make uv do global installs - -jobs: - ubuntu: - runs-on: ubuntu-latest - name: Python ${{ matrix.python }} (Docutils ${{ matrix.docutils }}) - strategy: - fail-fast: false - matrix: - python: - - "3.10" - - "3.11" - - "3.12" - docutils: - - "0.20" - - "0.21" -# include: -# # test every supported Docutils version for the latest supported Python -# - python: "3.12" -# docutils: "0.20" - - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v5 - 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/action@v3.2.0 - with: - python-version: ${{ matrix.python }} - - name: Check Python version - run: python --version --version - - name: Install graphviz - run: sudo apt-get install graphviz - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install .[test] - - name: Install Docutils ${{ matrix.docutils }} - run: python -m 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-free-threraded: - runs-on: ubuntu-latest - name: Python ${{ matrix.python }} (Docutils ${{ matrix.docutils }}; free-threaded) - 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/action@v3.2.0 - with: - python-version: ${{ matrix.python }} - nogil: true - - name: Check Python version - run: python --version --version - - name: Install graphviz - run: sudo apt-get install graphviz - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install .[test] - - name: Install Docutils ${{ matrix.docutils }} - run: python -m pip install --upgrade "docutils~=${{ matrix.docutils }}.0" - # markupsafe._speedups has not declared that it can run safely without the GIL - - name: Remove markupsafe._speedups - run: rm -rf "$(python -c 'from markupsafe._speedups import __file__ as f; print(f)')" - - name: Test with pytest - run: python -m pytest -vv --durations 25 - env: - PYTHONWARNINGS: "error" # treat all warnings as errors - - windows: - runs-on: windows-2019 - name: Windows - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - 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: uv pip install .[test] - - name: Test with pytest - run: python -m pytest -vv --durations 25 - env: - PYTHONWARNINGS: "error" # treat all warnings as errors - - docutils-latest: - runs-on: ubuntu-latest - name: Docutils HEAD - - steps: - - name: Install epubcheck - run: | - EPUBCHECK_VERSION="5.1.0" - mkdir /tmp/epubcheck && cd /tmp/epubcheck - 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 - with: - python-version: "3" - - 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' HEAD - run: uv pip install "docutils @ git+https://repo.or.cz/docutils.git#subdirectory=docutils" - - name: Test with pytest - run: python -m pytest -vv - env: - PYTHONWARNINGS: "error" # treat all warnings as errors - DO_EPUBCHECK: "1" - EPUBCHECK_PATH: "/tmp/epubcheck/epubcheck-5.1.0/epubcheck.jar" - - oldest-supported: - runs-on: ubuntu-latest - name: Oldest supported - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3" - - 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] --resolution lowest-direct - uv pip install alabaster==1.0.0 - - name: Test with pytest - run: python -m pytest -vv --durations 25 - env: - PYTHONWARNINGS: "error" # treat all warnings as errors - - latex: - runs-on: ubuntu-latest - name: LaTeX - container: - image: ghcr.io/sphinx-doc/sphinx-ci - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - 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: uv pip install .[test] - - name: Test with pytest - run: python -m pytest -vv --durations 25 - env: - PYTHONWARNINGS: "error" # treat all warnings as errors - DO_EPUBCHECK: "1" - - coverage: - if: github.event_name == 'push' && github.repository_owner == 'sphinx-doc' - runs-on: ubuntu-latest - name: Coverage - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3" - - 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] pytest-cov - - name: Test with pytest - run: python -m pytest -vv --cov . --cov-append --cov-config pyproject.toml - env: - VIRTUALENV_SYSTEM_SITE_PACKAGES: "1" - - name: codecov - uses: codecov/codecov-action@v4 diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml deleted file mode 100644 index 29359f90958..00000000000 --- a/.github/workflows/nodejs.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: CI (node.js) - -on: - push: - paths: - - ".github/workflows/nodejs.yml" - - "sphinx/themes/**.js" - - "tests/js/**" - - "package.json" - - "package-lock.json" - pull_request: - paths: - - ".github/workflows/nodejs.yml" - - "sphinx/themes/**.js" - - "tests/js/**" - - "package.json" - - "package-lock.json" - -permissions: - contents: read - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -env: - FORCE_COLOR: "1" - -jobs: - build: - runs-on: ubuntu-latest - env: - node-version: "20" - - steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ env.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ env.node-version }} - cache: "npm" - - run: npm install - - run: npm test diff --git a/.github/workflows/transifex.yml b/.github/workflows/transifex.yml deleted file mode 100644 index 78e74efcf5a..00000000000 --- a/.github/workflows/transifex.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Synchronise translations - -on: - schedule: - # 22:38 GMT, every Sunday. Chosen to be a random time. - - cron: "38 22 * * SUN" - workflow_dispatch: - -permissions: - contents: read - -jobs: - push: - if: github.repository_owner == 'sphinx-doc' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3" - - name: Install transifex client - run: | - mkdir -p /tmp/tx_cli && cd $_ - curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash - shell: bash - - name: Install dependencies - run: pip install --upgrade babel jinja2 - - name: Extract translations from source code - run: python utils/babel_runner.py extract - - name: Push translations to transifex.com - run: | - cd sphinx/locale - /tmp/tx_cli/tx push --source --use-git-timestamps --workers 10 - env: - TX_TOKEN: ${{ secrets.TX_TOKEN }} - - pull: - permissions: - contents: write # for peter-evans/create-pull-request to create branch - pull-requests: write # for peter-evans/create-pull-request to create a PR - if: github.repository_owner == 'sphinx-doc' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3" - - name: Install transifex client - run: | - mkdir -p /tmp/tx_cli && cd $_ - curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash - shell: bash - - name: Install dependencies - run: pip install --upgrade babel jinja2 - - name: Extract translations from source code - run: python utils/babel_runner.py extract - - name: Pull translations from transifex.com - run: | - cd sphinx/locale - /tmp/tx_cli/tx pull --translations --all --force --use-git-timestamps --workers 10 - env: - TX_TOKEN: ${{ secrets.TX_TOKEN }} - - name: Compile message catalogs - run: python utils/babel_runner.py compile - - name: Create Pull Request - uses: peter-evans/create-pull-request@v7 - with: - add-paths: | - sphinx/locale - commit-message: "[internationalisation] Update translations" - branch: bot/pull-translations - title: "[bot]: Update message catalogues" - labels: "internals:internationalisation" - body-path: babel_compile.txt