Skip to content

Commit

Permalink
Merge branch 'master' into linkcode-generic
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGES.rst
#	sphinx/application.py
#	sphinx/ext/linkcode.py
#	tests/roots/test-ext-viewcode/conf.py
#	tests/test_extensions/test_ext_viewcode.py
  • Loading branch information
AA-Turner committed Oct 21, 2024
2 parents 54e8225 + 8042eb6 commit fbf71ab
Show file tree
Hide file tree
Showing 1,069 changed files with 253,315 additions and 197,528 deletions.
9 changes: 8 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
max-line-length = 95
ignore =
E116,
E203,
E241,
E251,
E501,
E741,
W503,
W504,
Expand All @@ -22,10 +24,15 @@ exclude =
.git,
.tox,
.venv,
venv,
node_modules/*,
tests/roots/*,
build/*,
doc/_build/*,
sphinx/search/*,
doc/usage/extensions/example*.py,
per-file-ignores =
tests/*: E501
doc/conf.py:W605
sphinx/events.py:E704,
tests/test_extensions/ext_napoleon_pep526_data_google.py:MLL001,
tests/test_extensions/ext_napoleon_pep526_data_numpy.py:MLL001,
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,7 @@ f4c8a0a68e0013808d169357c9f77ebdf19d0f4e

# Change 'isort' profile
a13cf2c24dd16b37670ee1d359f511cbdfa4402d


# 2024 copyright year update
569fde84d49c984282355c768c16426af83132e2
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug report
description: Something is not working correctly.
labels: "bug"
labels: "type:bug"

body:
- type: textarea
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: '<short description for the feature>'
labels: 'enhancement'
labels: 'type:proposal'
assignees: ''

---
Expand Down
6 changes: 5 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
interval: "daily"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
22 changes: 13 additions & 9 deletions .github/workflows/builddoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,33 @@ concurrency:

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

jobs:
build:
verbose:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
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: |
python -m pip install --upgrade pip
python -m pip install .[docs]
run: uv pip install .[docs]
- name: Render the documentation
run: >
sphinx-build
-M html ./doc ./build/sphinx
-T
-W
--verbose
--jobs=auto
-vv
--keep-going
--show-traceback
--fail-on-warning
71 changes: 61 additions & 10 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,84 @@ on:
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:
publish-pypi:
runs-on: ubuntu-latest
name: PyPI Release
environment: release
if: github.repository_owner == 'sphinx-doc'
permissions:
attestations: write # for actions/attest
id-token: write # for PyPI trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install uv
run: >
curl --no-progress-meter --location --fail
--proto '=https' --tlsv1.2
"https://astral.sh/uv/install.sh"
| sh
- name: Install build dependencies (pypa/build, twine)
run: |
pip install -U pip
pip install build twine
uv pip install build "twine>=5.1"
# resolution fails without betterproto and protobuf-specs
uv pip install "pypi-attestations~=0.0.12" "sigstore-protobuf-specs==0.3.2" "betterproto==2.0.0b6"
- name: Build distribution
run: python -m build

- name: Check distribution
run: |
twine check dist/*
- name: Create Sigstore attestations for built distributions
uses: actions/attest@v1
id: attest
with:
subject-path: "dist/*"
predicate-type: "https://docs.pypi.org/attestations/publish/v1"
predicate: "null"
show-summary: "true"

- name: Convert attestations to PEP 740
# workflow_ref example: sphinx-doc/sphinx/.github/workflows/create-release.yml@refs/heads/master
run: >
python utils/convert_attestations.py
"${{ steps.attest.outputs.bundle-path }}"
"https://github.com/${{ github.workflow_ref }}"
- name: Inspect PEP 740 attestations
run: |
python -m pypi_attestations inspect dist/*.publish.attestation
- name: Prepare attestation bundles for uploading
run: |
mkdir -p /tmp/attestation-bundles
cp "${{ steps.attest.outputs.bundle-path }}" /tmp/attestation-bundles/
cp dist/*.publish.attestation /tmp/attestation-bundles/
- name: Upload attestation bundles
uses: actions/upload-artifact@v4
with:
name: attestation-bundles
path: /tmp/attestation-bundles/

- name: Mint PyPI API token
id: mint-token
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
# language=JavaScript
script: |
Expand Down Expand Up @@ -65,25 +116,25 @@ jobs:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: "${{ steps.mint-token.outputs.api-token }}"
run: |
twine check dist/*
twine upload dist/*
twine upload dist/* --attestations
github-release:
runs-on: ubuntu-latest
name: GitHub release
environment: release
if: github.repository_owner == 'sphinx-doc'
permissions:
contents: write # for softprops/action-gh-release to create GitHub release
steps:
- uses: actions/checkout@v4
- name: Get release version
id: get_version
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: core.setOutput('version', context.ref.replace("refs/tags/v", ""))

- name: Create GitHub release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
name: "Sphinx ${{ steps.get_version.outputs.version }}"
Expand Down
106 changes: 71 additions & 35 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,52 @@ 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
# tox environment
ruff:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3"
- name: Install pip
run: python -m pip install --upgrade pip
- 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: python -m pip install "ruff==0.1.9"
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 . --output-format github
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@v4
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>=3.5.0" "flake8-simplify"
run: uv pip install --upgrade "flake8>=6.0"
- name: Lint with flake8
run: flake8 .

Expand All @@ -56,54 +69,77 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
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 "mypy==1.8.0" docutils-stubs types-requests
run: uv pip install ".[lint,test]"
- name: Type check with mypy
run: mypy sphinx/
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@v4
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: >
sphinx-lint
--enable line-too-long
--max-line-length 85
AUTHORS.rst
CHANGES.rst
CODE_OF_CONDUCT.rst
CONTRIBUTING.rst
README.rst
doc/
run: make doclinter

twine:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
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
Loading

0 comments on commit fbf71ab

Please sign in to comment.