Skip to content

Commit 0eb5220

Browse files
authored
Merge branch 'master' into fix314
2 parents 90d672f + b6a7e43 commit 0eb5220

18 files changed

+884
-491
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", pypy-3.10]
13+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", pypy-3.10]
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-case-conflict
66
- id: check-merge-conflict
@@ -14,14 +14,14 @@ repos:
1414
- id: trailing-whitespace
1515

1616
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.5.0
17+
rev: v0.7.2
1818
hooks:
1919
- id: ruff
2020
args: [--fix, --show-fixes]
2121
- id: ruff-format
2222

2323
- repo: https://github.com/pre-commit/mirrors-mypy
24-
rev: v1.10.1
24+
rev: v1.13.0
2525
hooks:
2626
- id: mypy
2727
additional_dependencies: [ "typing_extensions" ]

docs/features.rst

+2-7
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,8 @@ As of version 4.3.0, Typeguard can check instances and classes against Protocols
6565
regardless of whether they were annotated with
6666
:func:`@runtime_checkable <typing.runtime_checkable>`.
6767

68-
There are several limitations on the checks performed, however:
69-
70-
* For non-callable members, only presence is checked for; no type compatibility checks
71-
are performed
72-
* For methods, only the number of positional arguments are checked against, so any added
73-
keyword-only arguments without defaults don't currently trip the checker
74-
* Likewise, argument types are not checked for compatibility
68+
The only current limitation is that argument annotations are not checked for
69+
compatibility, however this should be covered by static type checkers pretty well.
7570

7671
Special considerations for ``if TYPE_CHECKING:``
7772
------------------------------------------------

docs/versionhistory.rst

+26-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,35 @@ This library adheres to
66

77
**UNRELEASED**
88

9-
- Fixed basic support for intersection protocols
10-
(`#490 <https://github.com/agronholm/typeguard/pull/490>`_; PR by @antonagestam)
119
- Fix display of module name for forward references
1210
(`#492 <https://github.com/agronholm/typeguard/pull/492>`_; PR by @JelleZijlstra)
1311

12+
**4.4.1** (2024-11-03)
13+
14+
- Dropped Python 3.8 support
15+
- Changed the signature of ``typeguard_ignore()`` to be compatible with
16+
``typing.no_type_check()`` (PR by @jolaf)
17+
- Avoid creating reference cycles when type checking uniontypes and classes
18+
- Fixed checking of variable assignments involving tuple unpacking
19+
(`#486 <https://github.com/agronholm/typeguard/issues/486>`_)
20+
- Fixed ``TypeError`` when checking a class against ``type[Self]``
21+
(`#481 <https://github.com/agronholm/typeguard/issues/481>`_)
22+
- Fixed checking of protocols on the class level (against ``type[SomeProtocol]``)
23+
(`#498 <https://github.com/agronholm/typeguard/issues/498>`_)
24+
- Fixed ``Self`` checks in instance/class methods that have positional-only arguments
25+
- Fixed explicit checks of PEP 604 unions against ``types.UnionType``
26+
(`#467 <https://github.com/agronholm/typeguard/issues/467>`_)
27+
- Fixed checks against annotations wrapped in ``NotRequired`` not being run unless the
28+
``NotRequired`` is a forward reference
29+
(`#454 <https://github.com/agronholm/typeguard/issues/454>`_)
30+
31+
**4.4.0** (2024-10-27)
32+
33+
- Added proper checking for method signatures in protocol checks
34+
(`#465 <https://github.com/agronholm/typeguard/pull/465>`_)
35+
- Fixed basic support for intersection protocols
36+
(`#490 <https://github.com/agronholm/typeguard/pull/490>`_; PR by @antonagestam)
37+
1438
**4.3.0** (2024-05-27)
1539

1640
- Added support for checking against static protocols

pyproject.toml

+16-18
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ classifiers = [
1717
"License :: OSI Approved :: MIT License",
1818
"Programming Language :: Python",
1919
"Programming Language :: Python :: 3",
20-
"Programming Language :: Python :: 3.8",
2120
"Programming Language :: Python :: 3.9",
2221
"Programming Language :: Python :: 3.10",
2322
"Programming Language :: Python :: 3.11",
2423
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
2525
]
26-
requires-python = ">= 3.8"
26+
requires-python = ">= 3.9"
2727
dependencies = [
2828
"importlib_metadata >= 3.6; python_version < '3.10'",
2929
"typing_extensions >= 4.10.0",
@@ -80,36 +80,34 @@ src = ["src"]
8080

8181
[tool.ruff.lint]
8282
extend-select = [
83-
"W", # pycodestyle warnings
83+
"B0", # flake8-bugbear
8484
"I", # isort
8585
"PGH", # pygrep-hooks
8686
"UP", # pyupgrade
87-
"B0", # flake8-bugbear
87+
"W", # pycodestyle warnings
8888
]
8989
ignore = [
9090
"S307",
9191
"B008",
92+
"UP006",
93+
"UP035",
9294
]
9395

9496
[tool.mypy]
95-
python_version = "3.9"
97+
python_version = "3.11"
9698
strict = true
9799
pretty = true
98100

99101
[tool.tox]
100-
legacy_tox_ini = """
101-
[tox]
102-
envlist = pypy3, py38, py39, py310, py311, py312, py313
102+
env_list = ["py39", "py310", "py311", "py312", "py313"]
103103
skip_missing_interpreters = true
104-
minversion = 4.0
105104

106-
[testenv]
107-
extras = test
108-
commands = coverage run -m pytest {posargs}
109-
package = editable
105+
[tool.tox.env_run_base]
106+
commands = [["coverage", "run", "-m", "pytest", { replace = "posargs", extend = true }]]
107+
package = "editable"
108+
extras = ["test"]
110109

111-
[testenv:docs]
112-
extras = doc
113-
package = editable
114-
commands = sphinx-build -W -n docs build/sphinx
115-
"""
110+
[tool.tox.env.docs]
111+
depends = []
112+
extras = ["doc"]
113+
commands = [["sphinx-build", "-W", "-n", "docs", "build/sphinx"]]

0 commit comments

Comments
 (0)