Skip to content

Annotate the list of strings correctly for Sphinx 8.2+ #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Set up Python 3.11
- name: Set up Python 3.13
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.13"
- name: Install dependencies
run: python -m pip install tox
- name: Run tox
Expand All @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout source code
uses: actions/checkout@v3
Expand Down Expand Up @@ -52,10 +52,10 @@ jobs:
# We need history to build the package
with:
fetch-depth: 0
- name: Set up Python 3.11
- name: Set up Python 3.13
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.13"
- name: Install dependencies
run: python -m pip install build
- name: Build a binary wheel and a source tarball
Expand Down
19 changes: 7 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
---
default_language_version:
# force all unspecified python hooks to run python3
python: python3
repos:
- repo: https://github.com/ambv/black
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
Expand All @@ -23,12 +16,14 @@ repos:
- id: check-yaml
files: .*\.(yaml|yml)$
- id: check-added-large-files
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.8
hooks:
- id: flake8
- id: ruff
args: ['--fix', '--unsafe-fixes']
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.15.0
hooks:
- id: mypy
additional_dependencies:
Expand Down
21 changes: 6 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
[tool.black]
[tool.ruff]
line-length = 88
target-version = ['py38']
skip-string-normalization = true
exclude = '''
(
/(
\.eggs
| \.git
| \.tox
| \.venv
| build
| dist
)
)
'''
target-version = 'py39'

[tool.ruff.format]
quote-style = "preserve"
docstring-code-format = true
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers =
Topic :: Documentation
Topic :: Documentation :: Sphinx
Topic :: Utilities
python_requires = >=3.8
python_requires = >=3.9
keywords = sphinx

[files]
Expand Down
12 changes: 6 additions & 6 deletions sphinxcontrib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""
sphinxcontrib
~~~~~~~~~~~~~
sphinxcontrib
~~~~~~~~~~~~~

This package is a namespace package that contains all extensions
distributed in the ``sphinx-contrib`` distribution.
This package is a namespace package that contains all extensions
distributed in the ``sphinx-contrib`` distribution.

:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

__import__('pkg_resources').declare_namespace(__name__)
12 changes: 6 additions & 6 deletions sphinxcontrib/apidoc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""
sphinxcontrib.apidoc
~~~~~~~~~~~~~~~~~~~~
sphinxcontrib.apidoc
~~~~~~~~~~~~~~~~~~~~

A Sphinx extension for running 'sphinx-apidoc' on each build.
A Sphinx extension for running 'sphinx-apidoc' on each build.

:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
:license: BSD, see LICENSE for details.
:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
:license: BSD, see LICENSE for details.
"""

import pbr.version
Expand All @@ -24,7 +24,7 @@ def setup(app: Sphinx) -> Dict[str, Any]:
app.add_config_value('apidoc_module_dir', None, 'env', [str])
app.add_config_value('apidoc_output_dir', 'api', 'env', [str])
app.add_config_value('apidoc_template_dir', 'templates', 'env', [str])
app.add_config_value('apidoc_excluded_paths', [], 'env', [[str]])
app.add_config_value('apidoc_excluded_paths', [], 'env', list[str])
app.add_config_value('apidoc_separate_modules', False, 'env', [bool])
app.add_config_value('apidoc_toc_file', None, 'env', [str, bool])
app.add_config_value('apidoc_module_first', False, 'env', [bool])
Expand Down
14 changes: 6 additions & 8 deletions sphinxcontrib/apidoc/ext.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""
sphinxcontrib.apidoc.ext
~~~~~~~~~~~~~~~~~~~~~~~~
sphinxcontrib.apidoc.ext
~~~~~~~~~~~~~~~~~~~~~~~~

A Sphinx extension for running 'sphinx-apidoc' on each build.
A Sphinx extension for running 'sphinx-apidoc' on each build.

:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
:license: BSD, see LICENSE for details.
:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
:license: BSD, see LICENSE for details.
"""

from os import path
Expand All @@ -28,9 +28,7 @@ def builder_inited(app: Sphinx) -> None:
extra_args = app.config.apidoc_extra_args

if not module_dir:
logger.warning(
"No 'apidoc_module_dir' specified; skipping API doc " "generation"
)
logger.warning("No 'apidoc_module_dir' specified; skipping API doc generation")
return

# if the path is relative, make it relative to the 'conf.py' directory
Expand Down
8 changes: 4 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
pytest config for sphinxcontrib/apidoc/tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pytest config for sphinxcontrib/apidoc/tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
:license: BSD, see LICENSE for details.
:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
:license: BSD, see LICENSE for details.
"""

import os
Expand Down
10 changes: 5 additions & 5 deletions tests/test_ext.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
"""
test_apidoc
~~~~~~~~~~~
test_apidoc
~~~~~~~~~~~

Test the sphinxcontrib.apidoc module.
Test the sphinxcontrib.apidoc module.

:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
:license: BSD, see LICENSE for details.
:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
:license: BSD, see LICENSE for details.
"""

import pytest
Expand Down