From 5a6f7982ded90fe04324ae0812deb29b37f1922c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 08:08:33 -0800 Subject: [PATCH 1/7] [pre-commit.ci] pre-commit autoupdate (#518) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.9.1 → v0.9.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.1...v0.9.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c21124b..b6f9395 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.1" + rev: "v0.9.2" hooks: - id: ruff-format - id: ruff From da5feae414692e2394ce5df2f1bceec34e694abb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 08:03:23 -0800 Subject: [PATCH 2/7] Bump pypa/gh-action-pypi-publish from 1.12.3 to 1.12.4 (#519) Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.12.3 to 1.12.4. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.12.3...v1.12.4) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index df29627..8662416 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,6 +43,6 @@ jobs: name: ${{ env.dists-artifact-name }} path: dist/ - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.12.3 + uses: pypa/gh-action-pypi-publish@v1.12.4 with: attestations: true From bfa7f43c11676907003e88366566d233ce49e70a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 10:02:30 -0800 Subject: [PATCH 3/7] [pre-commit.ci] pre-commit autoupdate (#520) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/codespell-project/codespell: v2.3.0 → v2.4.0](https://github.com/codespell-project/codespell/compare/v2.3.0...v2.4.0) - [github.com/tox-dev/tox-ini-fmt: 1.4.1 → 1.5.0](https://github.com/tox-dev/tox-ini-fmt/compare/1.4.1...1.5.0) - [github.com/astral-sh/ruff-pre-commit: v0.9.2 → v0.9.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.2...v0.9.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b6f9395..025ae0a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,12 +10,12 @@ repos: - id: check-github-workflows args: ["--verbose"] - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 + rev: v2.4.0 hooks: - id: codespell additional_dependencies: ["tomli>=2.2.1"] - repo: https://github.com/tox-dev/tox-ini-fmt - rev: "1.4.1" + rev: "1.5.0" hooks: - id: tox-ini-fmt args: ["-p", "fix"] @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.2" + rev: "v0.9.3" hooks: - id: ruff-format - id: ruff From fd427dc0772f0cc35bc3494e0d7c939c98ceac9b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:11:36 -0800 Subject: [PATCH 4/7] [pre-commit.ci] pre-commit autoupdate (#521) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.31.0 → 0.31.1](https://github.com/python-jsonschema/check-jsonschema/compare/0.31.0...0.31.1) - [github.com/codespell-project/codespell: v2.4.0 → v2.4.1](https://github.com/codespell-project/codespell/compare/v2.4.0...v2.4.1) - [github.com/astral-sh/ruff-pre-commit: v0.9.3 → v0.9.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.3...v0.9.4) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 025ae0a..040957b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,12 +5,12 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: "0.31.0" + rev: "0.31.1" hooks: - id: check-github-workflows args: ["--verbose"] - repo: https://github.com/codespell-project/codespell - rev: v2.4.0 + rev: v2.4.1 hooks: - id: codespell additional_dependencies: ["tomli>=2.2.1"] @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.3" + rev: "v0.9.4" hooks: - id: ruff-format - id: ruff From 6ffdf92ffce85c9dce596faf682d457dc6429c70 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 10:48:11 -0800 Subject: [PATCH 5/7] [pre-commit.ci] pre-commit autoupdate (#522) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.9.4 → v0.9.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.4...v0.9.6) - [github.com/rbubley/mirrors-prettier: v3.4.2 → v3.5.0](https://github.com/rbubley/mirrors-prettier/compare/v3.4.2...v3.5.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- tests/test_sphinx_autodoc_typehints.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 040957b..b4e653f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,13 +24,13 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.4" + rev: "v0.9.6" hooks: - id: ruff-format - id: ruff args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"] - repo: https://github.com/rbubley/mirrors-prettier - rev: "v3.4.2" # Use the sha / tag you want to point at + rev: "v3.5.0" # Use the sha / tag you want to point at hooks: - id: prettier additional_dependencies: diff --git a/tests/test_sphinx_autodoc_typehints.py b/tests/test_sphinx_autodoc_typehints.py index 6edcfcf..31e077e 100644 --- a/tests/test_sphinx_autodoc_typehints.py +++ b/tests/test_sphinx_autodoc_typehints.py @@ -98,10 +98,10 @@ class Metaclass(type): ... class HintedMethods: @classmethod - def from_magic(cls: type[T]) -> T: # type: ignore[empty-body] + def from_magic(cls) -> typing_extensions.Self: # type: ignore[empty-body] ... - def method(self: T) -> T: # type: ignore[empty-body] + def method(self) -> typing_extensions.Self: # type: ignore[empty-body] ... From f09eb89ba1fe60a71b1bb0711a82e5bb8476b5ea Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 14:04:35 -0800 Subject: [PATCH 6/7] [pre-commit.ci] pre-commit autoupdate (#524) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/rbubley/mirrors-prettier: v3.5.0 → v3.5.1](https://github.com/rbubley/mirrors-prettier/compare/v3.5.0...v3.5.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b4e653f..aaf240a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: - id: ruff args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"] - repo: https://github.com/rbubley/mirrors-prettier - rev: "v3.5.0" # Use the sha / tag you want to point at + rev: "v3.5.1" # Use the sha / tag you want to point at hooks: - id: prettier additional_dependencies: From ca5fcc0f37461601ce0b2682cc96ce16d028febc Mon Sep 17 00:00:00 2001 From: bart <61748872+b-kamphorst@users.noreply.github.com> Date: Wed, 19 Feb 2025 16:37:41 +0100 Subject: [PATCH 7/7] Support Sphinx 8.2.0 - drop 3.10 support because Sphinx does (#525) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency sphinx to v8.2.0 * refactor: patch stringify_annotation with arbitrary *args and **kwargs * fix: derive annotation for TypeAliasForwardRef from its name attribute TypeAliasForwardRef.__repr__ was changed in sphinx v8.2.0 to not only yield the name, but also the class name. * test: update warning message "unpickable" was renamed to "unpickleable" in sphinx v8.2.0 * feat: respect configuration option python_display_short_literal_types https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-python_display_short_literal_types * Sphinx 8.2 drops 3.10 support Signed-off-by: Bernát Gábor --------- Signed-off-by: Bernát Gábor Co-authored-by: Bernát Gábor --- .github/workflows/check.yaml | 1 - .pre-commit-config.yaml | 2 +- pyproject.toml | 11 ++-- src/sphinx_autodoc_typehints/__init__.py | 31 ++++++---- .../attributes_patch.py | 4 +- tests/conftest.py | 5 +- tests/test_integration.py | 56 ++++++++++++++++++- tests/test_sphinx_autodoc_typehints.py | 13 +---- tox.ini | 11 ++-- 9 files changed, 91 insertions(+), 43 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 0800434..c028c36 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -22,7 +22,6 @@ jobs: - "3.13" - "3.12" - "3.11" - - "3.10" - type - dev - pkg_meta diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aaf240a..fb3e099 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: hooks: - id: prettier additional_dependencies: - - prettier@3.4.2 + - prettier@3.5.1 - "@prettier/plugin-xml@3.4.1" - repo: meta hooks: diff --git a/pyproject.toml b/pyproject.toml index d60d302..1fbdbdb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ maintainers = [ authors = [ { name = "Bernát Gábor", email = "gaborjbernat@gmail.com" }, ] -requires-python = ">=3.10" +requires-python = ">=3.11" classifiers = [ "Development Status :: 5 - Production/Stable", "Framework :: Sphinx :: Extension", @@ -31,7 +31,6 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", @@ -41,16 +40,16 @@ dynamic = [ "version", ] dependencies = [ - "sphinx>=8.1.3", + "sphinx>=8.2", ] optional-dependencies.docs = [ "furo>=2024.8.6", ] optional-dependencies.testing = [ "covdefaults>=2.3", - "coverage>=7.6.10", + "coverage>=7.6.12", "defusedxml>=0.7.1", # required by sphinx.testing - "diff-cover>=9.2.1", + "diff-cover>=9.2.3", "pytest>=8.3.4", "pytest-cov>=6", "sphobjinv>=2.3.1.2", @@ -142,7 +141,7 @@ run.plugins = [ ] [tool.mypy] -python_version = "3.10" +python_version = "3.11" strict = true exclude = "^(.*/roots/.*)|(tests/test_integration.*.py)$" overrides = [ diff --git a/src/sphinx_autodoc_typehints/__init__.py b/src/sphinx_autodoc_typehints/__init__.py index e621592..432fdf4 100644 --- a/src/sphinx_autodoc_typehints/__init__.py +++ b/src/sphinx_autodoc_typehints/__init__.py @@ -172,11 +172,11 @@ def get_annotation_args(annotation: Any, module: str, class_name: str) -> tuple[ return () if len(result) == 1 and result[0] == () else result # type: ignore[misc] -def format_internal_tuple(t: tuple[Any, ...], config: Config) -> str: +def format_internal_tuple(t: tuple[Any, ...], config: Config, *, short_literals: bool = False) -> str: # An annotation can be a tuple, e.g., for numpy.typing: # In this case, format_annotation receives: # This solution should hopefully be general for *any* type that allows tuples in annotations - fmt = [format_annotation(a, config) for a in t] + fmt = [format_annotation(a, config, short_literals=short_literals) for a in t] if len(fmt) == 0: return "()" if len(fmt) == 1: @@ -196,12 +196,13 @@ def fixup_module_name(config: Config, module: str) -> str: return module -def format_annotation(annotation: Any, config: Config) -> str: # noqa: C901, PLR0911, PLR0912, PLR0915, PLR0914 +def format_annotation(annotation: Any, config: Config, *, short_literals: bool = False) -> str: # noqa: C901, PLR0911, PLR0912, PLR0915, PLR0914 """ Format the annotation. :param annotation: :param config: + :param short_literals: Render :py:class:`Literals` in PEP 604 style (``|``). :return: """ typehints_formatter: Callable[..., str] | None = getattr(config, "typehints_formatter", None) @@ -222,7 +223,7 @@ def format_annotation(annotation: Any, config: Config) -> str: # noqa: C901, PL return format_internal_tuple(annotation, config) if isinstance(annotation, TypeAliasForwardRef): - return str(annotation) + return annotation.name try: module = get_annotation_module(annotation) @@ -254,7 +255,7 @@ def format_annotation(annotation: Any, config: Config) -> str: # noqa: C901, PL params = {k: getattr(annotation, f"__{k}__") for k in ("bound", "covariant", "contravariant")} params = {k: v for k, v in params.items() if v} if "bound" in params: - params["bound"] = f" {format_annotation(params['bound'], config)}" + params["bound"] = f" {format_annotation(params['bound'], config, short_literals=short_literals)}" args_format = f"\\(``{annotation.__name__}``{', {}' if args else ''}" if params: args_format += "".join(f", {k}={v}" for k, v in params.items()) @@ -275,20 +276,22 @@ def format_annotation(annotation: Any, config: Config) -> str: # noqa: C901, PL args_format = f"\\[:py:data:`{prefix}typing.Union`\\[{{}}]]" args = tuple(x for x in args if x is not type(None)) elif full_name in {"typing.Callable", "collections.abc.Callable"} and args and args[0] is not ...: - fmt = [format_annotation(arg, config) for arg in args] + fmt = [format_annotation(arg, config, short_literals=short_literals) for arg in args] formatted_args = f"\\[\\[{', '.join(fmt[:-1])}], {fmt[-1]}]" elif full_name == "typing.Literal": + if short_literals: + return f"\\{' | '.join(f'``{arg!r}``' for arg in args)}" formatted_args = f"\\[{', '.join(f'``{arg!r}``' for arg in args)}]" elif is_bars_union: - return " | ".join([format_annotation(arg, config) for arg in args]) + return " | ".join([format_annotation(arg, config, short_literals=short_literals) for arg in args]) if args and not formatted_args: try: iter(args) except TypeError: - fmt = [format_annotation(args, config)] + fmt = [format_annotation(args, config, short_literals=short_literals)] else: - fmt = [format_annotation(arg, config) for arg in args] + fmt = [format_annotation(arg, config, short_literals=short_literals) for arg in args] formatted_args = args_format.format(", ".join(fmt)) escape = "\\ " if formatted_args else "" @@ -783,7 +786,10 @@ def _inject_signature( if annotation is None: type_annotation = f":type {arg_name}: " else: - formatted_annotation = add_type_css_class(format_annotation(annotation, app.config)) + short_literals = app.config.python_display_short_literal_types + formatted_annotation = add_type_css_class( + format_annotation(annotation, app.config, short_literals=short_literals) + ) type_annotation = f":type {arg_name}: {formatted_annotation}" if app.config.typehints_defaults: @@ -923,7 +929,10 @@ def _inject_rtype( # noqa: PLR0913, PLR0917 if not app.config.typehints_use_rtype and r.found_return and " -- " in lines[insert_index]: return - formatted_annotation = add_type_css_class(format_annotation(type_hints["return"], app.config)) + short_literals = app.config.python_display_short_literal_types + formatted_annotation = add_type_css_class( + format_annotation(type_hints["return"], app.config, short_literals=short_literals) + ) if r.found_param and insert_index < len(lines) and lines[insert_index].strip(): insert_index -= 1 diff --git a/src/sphinx_autodoc_typehints/attributes_patch.py b/src/sphinx_autodoc_typehints/attributes_patch.py index d038eae..276dbd0 100644 --- a/src/sphinx_autodoc_typehints/attributes_patch.py +++ b/src/sphinx_autodoc_typehints/attributes_patch.py @@ -42,12 +42,12 @@ orig_handle_signature = PyAttribute.handle_signature -def _stringify_annotation(app: Sphinx, annotation: Any, mode: str = "") -> str: # noqa: ARG001 +def _stringify_annotation(app: Sphinx, annotation: Any, *args: Any, short_literals: bool = False, **kwargs: Any) -> str: # noqa: ARG001 # Format the annotation with sphinx-autodoc-typehints and inject our magic prefix to tell our patched # PyAttribute.handle_signature to treat it as rst. from . import format_annotation # noqa: PLC0415 - return TYPE_IS_RST_LABEL + format_annotation(annotation, app.config) + return TYPE_IS_RST_LABEL + format_annotation(annotation, app.config, short_literals=short_literals) def patch_attribute_documenter(app: Sphinx) -> None: diff --git a/tests/conftest.py b/tests/conftest.py index 91874ad..19b09f3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,6 +3,7 @@ import re import shutil import sys +from contextlib import suppress from pathlib import Path from typing import TYPE_CHECKING @@ -36,11 +37,9 @@ def _remove_sphinx_projects(sphinx_test_tempdir: Path) -> None: # the temporary directory area. # See https://github.com/sphinx-doc/sphinx/issues/4040 for entry in sphinx_test_tempdir.iterdir(): - try: + with suppress(PermissionError): if entry.is_dir() and Path(entry, "_build").exists(): shutil.rmtree(str(entry)) - except PermissionError: # noqa: PERF203 - pass @pytest.fixture diff --git a/tests/test_integration.py b/tests/test_integration.py index c0d218b..900d585 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -9,6 +9,7 @@ from typing import ( # no type comments TYPE_CHECKING, Any, + Literal, NewType, Optional, TypeVar, @@ -661,6 +662,59 @@ def func_with_overload(a: Union[int, str], b: Union[int, str]) -> None: """ +@expected( + """\ +mod.func_literals_long_format(a, b) + + A docstring. + + Parameters: + * **a** ("Literal"["'arg1'", "'arg2'"]) -- Argument that can + take either of two literal values. + + * **b** ("Literal"["'arg1'", "'arg2'"]) -- Argument that can + take either of two literal values. + + Return type: + "None" +""", +) +def func_literals_long_format(a: Literal["arg1", "arg2"], b: Literal["arg1", "arg2"]) -> None: + """ + A docstring. + + :param a: Argument that can take either of two literal values. + :param b: Argument that can take either of two literal values. + """ + + +@expected( + """\ +mod.func_literals_short_format(a, b) + + A docstring. + + Parameters: + * **a** ("'arg1'" | "'arg2'") -- Argument that can take either + of two literal values. + + * **b** ("'arg1'" | "'arg2'") -- Argument that can take either + of two literal values. + + Return type: + "None" +""", + python_display_short_literal_types=True, +) +def func_literals_short_format(a: Literal["arg1", "arg2"], b: Literal["arg1", "arg2"]) -> None: + """ + A docstring. + + :param a: Argument that can take either of two literal values. + :param b: Argument that can take either of two literal values. + """ + + @expected( """\ class mod.TestClassAttributeDocs @@ -1386,7 +1440,7 @@ def has_doctest1() -> None: Unformatted = TypeVar("Unformatted") -@warns("cannot cache unpickable configuration value: 'typehints_formatter'") +@warns("cannot cache unpickleable configuration value: 'typehints_formatter'") @expected( """ mod.typehints_formatter_applied_to_signature(param: Formatted) -> Formatted diff --git a/tests/test_sphinx_autodoc_typehints.py b/tests/test_sphinx_autodoc_typehints.py index 31e077e..c0963c2 100644 --- a/tests/test_sphinx_autodoc_typehints.py +++ b/tests/test_sphinx_autodoc_typehints.py @@ -554,17 +554,6 @@ class dummy_module.DataClass(x) assert contents == expected_contents -def maybe_fix_py310(expected_contents: str) -> str: - if sys.version_info >= (3, 11): - return expected_contents - - for old, new in [ - ('"str" | "None"', '"Optional"["str"]'), - ]: - expected_contents = expected_contents.replace(old, new) - return expected_contents - - @pytest.mark.sphinx("text", testroot="dummy") @patch("sphinx.writers.text.MAXWIDTH", 2000) def test_sphinx_output_future_annotations(app: SphinxTestApp, status: StringIO) -> None: @@ -595,7 +584,7 @@ def test_sphinx_output_future_annotations(app: SphinxTestApp, status: StringIO) "str" """ expected_contents = dedent(expected_contents) - expected_contents = maybe_fix_py310(dedent(expected_contents)) + expected_contents = dedent(expected_contents) assert contents == expected_contents diff --git a/tox.ini b/tox.ini index eef0f28..07cd05a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,12 @@ [tox] requires = - tox>=4.23.2 - tox-uv>=1.16.2 + tox>=4.24.1 + tox-uv>=1.24 env_list = fix 3.13 3.12 3.11 - 3.10 type pkg_meta skip_missing_interpreters = true @@ -45,7 +44,7 @@ commands = [testenv:type] description = run type check on code base deps = - mypy==1.14 + mypy==1.15 types-docutils>=0.21.0.20241128 commands = mypy src @@ -56,8 +55,8 @@ description = check that the long description is valid skip_install = true deps = check-wheel-contents>=0.6.1 - twine>=6.0.1 - uv>=0.5.11 + twine>=6.1 + uv>=0.6.1 commands = uv build --sdist --wheel --out-dir {env_tmp_dir} . twine check {env_tmp_dir}{/}*