Skip to content

Commit

Permalink
Bump actions/setup-python from 4 to 5 (#408)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
  • Loading branch information
dependabot[bot] authored and gaborbernat committed Feb 13, 2024
1 parent 9fa846f commit 0fa026f
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 49 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: check
on:
workflow_dispatch:
push:
branches: ["main"]
tags-ignore: ["**"]
pull_request:
schedule:
Expand All @@ -18,7 +20,7 @@ jobs:
fail-fast: false
matrix:
py:
- "3.12.0-beta.2"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
Expand All @@ -27,7 +29,7 @@ jobs:
- name: Setup python for tox
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
- name: Install tox
run: python -m pip install tox
- uses: actions/checkout@v4
Expand Down Expand Up @@ -76,7 +78,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
- name: Install tox
run: python -m pip install tox
- name: Setup coverage tool
Expand Down Expand Up @@ -112,10 +114,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python "3.11"
- name: Setup Python "3.12"
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
- name: Install tox
run: python -m pip install tox
- name: Setup test suite
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup python to build package
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
- name: Install build
run: python -m pip install build
- uses: actions/checkout@v4
Expand Down
28 changes: 15 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,32 @@ repos:
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.6"
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 23.11.0
- id: check-github-workflows
args: [ "--verbose" ]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: black
- id: codespell
args: ["--write-changes"]
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: "1.3.1"
hooks:
- id: tox-ini-fmt
args: ["-p", "fix"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "1.5.1"
rev: "1.7.0"
hooks:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.8"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
additional_dependencies: ["tox>=4.12.1"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.2.1"
hooks:
- id: prettier
args: ["--print-width=120", "--prose-wrap=always"]
- id: ruff-format
- id: ruff
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,13 @@
- Fixed `NameError` when processing signatures of wrapped functions with type hints
- Fixed handling of slotted classes with no `__init__()` method
- Fixed Sphinx warning about parallel reads
- Fixed return type being added to class docstring from its `__init__()` method (thanks to Manuel Krebber for the patch)
- Fixed return type being added to class docstring from its `__init__()` method (thanks to Manual Krebber for the patch)
- Fixed return type hints of `@property` methods being omitted (thanks to pknight for the patch)
- Added a test suite (thanks Manuel Krebber)
- Added a test suite (thanks Manual Krebber)

## 1.1.0

- Added proper support for `typing.Tuple` (pull request by Manuel Krebber)
- Added proper support for `typing.Tuple` (pull request by Manual Krebber)

## 1.0.6

Expand Down
35 changes: 22 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"hatch-vcs>=0.3",
"hatch-vcs>=0.4",
"hatchling>=1.18",
]

Expand Down Expand Up @@ -41,20 +41,19 @@ dependencies = [
"Sphinx>=7.1.2",
]
optional-dependencies.docs = [
"furo>=2023.7.26",
"sphinx>=7.1.2",
"furo>=2023.9.10",
]
optional-dependencies.numpy = [
"nptyping>=2.5",
]
optional-dependencies.testing = [
"covdefaults>=2.3",
"coverage>=7.3",
"diff-cover>=7.7",
"pytest>=7.4",
"coverage>=7.3.2",
"diff-cover>=8.0.1",
"pytest>=7.4.3",
"pytest-cov>=4.1",
"sphobjinv>=2.3.1",
"typing-extensions>=4.7.1",
"typing-extensions>=4.8",
]
urls.Changelog = "https://github.com/tox-dev/sphinx-autodoc-typehints/blob/main/CHANGELOG.md"
urls.Homepage = "https://github.com/tox-dev/sphinx-autodoc-typehints"
Expand All @@ -69,27 +68,37 @@ version.source = "vcs"
line-length = 120

[tool.ruff]
select = ["ALL"]
line-length = 120
target-version = "py37"
isort = {known-first-party = ["tox", "tests"], required-imports = ["from __future__ import annotations"]}
ignore = [
"ANN101", # no typoe annotation for self
lint.select = ["ALL"]
lint.isort = {known-first-party = ["sphinx_autodoc_typehints", "tests"], required-imports = ["from __future__ import annotations"]}
lint.ignore = [
"ANN101", # no type annotation for self
"ANN401", # allow Any as type annotation
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
"S104", # Possible binding to all interface
"COM812", # Conflict with formatter
"ISC001", # Conflict with formatter
"CPY", # No copyright statements
]
[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"S101", # asserts allowed in tests...
"FBT", # don"t care about booleans as positional arguments in tests
"INP001", # no implicit namespace
"D", # don"t care about documentation in tests
"D", # don't care about documentation in tests
"S603", # `subprocess` call: check for execution of untrusted input
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
"PLR0913", # any number of arguments in tests
"PLR0917", # any number of arguments in tests
]

[tool.codespell]
builtin = "clear,usage,en-GB_to_en-US"
count = true
ignore-words-list = "master"

[tool.pytest.ini_options]
testpaths = ["tests"]

Expand Down
2 changes: 1 addition & 1 deletion src/sphinx_autodoc_typehints/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ def _inject_signature( # noqa: C901
lines: list[str],
) -> None:
for arg_name in signature.parameters:
annotation = type_hints.get(arg_name, None)
annotation = type_hints.get(arg_name)

default = signature.parameters[arg_name].default

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SomeClass:
@classmethod
def from_str(cls, input_value: str) -> SomeClass: # noqa: ANN102
"""
Initialise from string
Initialize from string
:param input_value: Input
:return: result
Expand All @@ -26,7 +26,7 @@ def from_str(cls, input_value: str) -> SomeClass: # noqa: ANN102
@classmethod
def from_date(cls, input_value: datetime.date) -> SomeClass: # noqa: ANN102
"""
Initialise from date
Initialize from date
:param input_value: Input
:return: result
Expand All @@ -36,7 +36,7 @@ def from_date(cls, input_value: datetime.date) -> SomeClass: # noqa: ANN102
@classmethod
def from_time(cls, input_value: datetime.time) -> SomeClass: # noqa: ANN102
"""
Initialise from time
Initialize from time
:param input_value: Input
:return: result
Expand Down
8 changes: 4 additions & 4 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ def docstring_with_bullet_list_after_params(param: int) -> None: # noqa: ARG001
maybe multiple lines
Next Term
Somethign about it
Something about it
""",
)
Expand All @@ -1112,7 +1112,7 @@ def docstring_with_definition_list_after_params(param: int) -> None: # noqa: AR
maybe multiple lines
Next Term
Somethign about it
Something about it
"""


Expand Down Expand Up @@ -1164,7 +1164,7 @@ def docstring_with_enum_list_after_params(param: int) -> None: # noqa: ARG001
maybe multiple lines
Next Term
Somethign about it
Something about it
-[ Example ]-
""",
Expand All @@ -1181,7 +1181,7 @@ def docstring_with_definition_list_after_params_no_blank_line(param: int) -> Non
maybe multiple lines
Next Term
Somethign about it
Something about it
.. rubric:: Example
"""

Expand Down
1 change: 1 addition & 0 deletions tests/test_sphinx_autodoc_typehints.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import typing_extensions
from sphinx.application import Sphinx
from sphinx.config import Config

from sphinx_autodoc_typehints import (
_resolve_type_guarded_imports,
backfill_type_hints,
Expand Down
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ commands =
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
skip_install = true
deps =
pre-commit>=3.3.3
pre-commit>=3.5
commands =
pre-commit run --all-files --show-diff-on-failure

Expand All @@ -51,8 +51,8 @@ extras =
[testenv:type]
description = run type check on code base
deps =
mypy==1.4.1
types-docutils>=0.20.0.2
mypy==1.7.1
types-docutils>=0.20.0.3
set_env =
{tty:MYPY_FORCE_COLOR = 1}
commands =
Expand All @@ -64,8 +64,8 @@ description = combine coverage files and generate diff (against DIFF_AGAINST def
skip_install = true
deps =
covdefaults>=2.3
coverage>=7.3
diff-cover>=7.7
coverage>=7.3.2
diff-cover>=8.0.1
extras =
parallel_show_output = true
pass_env =
Expand All @@ -90,7 +90,7 @@ depends =
description = check that the long description is valid (need for PyPI)
skip_install = true
deps =
build[virtualenv]>=0.10
build[virtualenv]>=1.0.3
twine>=4.0.2
extras =
commands =
Expand Down

0 comments on commit 0fa026f

Please sign in to comment.