diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8ff15ed..c33bd20 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 @@ -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 @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4502ab3..20b1031 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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: diff --git a/pyproject.toml b/pyproject.toml index ceb090e..d60159d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 diff --git a/setup.cfg b/setup.cfg index 115a992..8b4ea91 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,7 +24,7 @@ classifiers = Topic :: Documentation Topic :: Documentation :: Sphinx Topic :: Utilities -python_requires = >=3.8 +python_requires = >=3.9 keywords = sphinx [files] diff --git a/sphinxcontrib/__init__.py b/sphinxcontrib/__init__.py index ae0f862..f063f5d 100644 --- a/sphinxcontrib/__init__.py +++ b/sphinxcontrib/__init__.py @@ -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__) diff --git a/sphinxcontrib/apidoc/__init__.py b/sphinxcontrib/apidoc/__init__.py index a91570a..68a7130 100644 --- a/sphinxcontrib/apidoc/__init__.py +++ b/sphinxcontrib/apidoc/__init__.py @@ -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 - :license: BSD, see LICENSE for details. +:copyright: Copyright 2018-present by Stephen Finucane +:license: BSD, see LICENSE for details. """ import pbr.version @@ -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]) diff --git a/sphinxcontrib/apidoc/ext.py b/sphinxcontrib/apidoc/ext.py index cb720ed..508aa38 100644 --- a/sphinxcontrib/apidoc/ext.py +++ b/sphinxcontrib/apidoc/ext.py @@ -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 - :license: BSD, see LICENSE for details. +:copyright: Copyright 2018-present by Stephen Finucane +:license: BSD, see LICENSE for details. """ from os import path @@ -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 diff --git a/tests/conftest.py b/tests/conftest.py index 88d69de..5d753fe 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,9 +1,9 @@ """ - pytest config for sphinxcontrib/apidoc/tests - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +pytest config for sphinxcontrib/apidoc/tests +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2018-present by Stephen Finucane - :license: BSD, see LICENSE for details. +:copyright: Copyright 2018-present by Stephen Finucane +:license: BSD, see LICENSE for details. """ import os diff --git a/tests/test_ext.py b/tests/test_ext.py index df5c1e0..bf57bb3 100644 --- a/tests/test_ext.py +++ b/tests/test_ext.py @@ -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 - :license: BSD, see LICENSE for details. +:copyright: Copyright 2018-present by Stephen Finucane +:license: BSD, see LICENSE for details. """ import pytest