Skip to content

Commit

Permalink
Merge branch 'master' into fix_ref_cycles
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm authored Nov 3, 2024
2 parents 39c3eab + 28dafec commit 3699518
Show file tree
Hide file tree
Showing 17 changed files with 685 additions and 441 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", pypy-3.10]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", pypy-3.10]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
Expand All @@ -14,14 +14,14 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
rev: v0.7.2
hooks:
- id: ruff
args: [--fix, --show-fixes]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies: [ "typing_extensions" ]
Expand Down
9 changes: 2 additions & 7 deletions docs/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,8 @@ As of version 4.3.0, Typeguard can check instances and classes against Protocols
regardless of whether they were annotated with
:func:`@runtime_checkable <typing.runtime_checkable>`.

There are several limitations on the checks performed, however:

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

Special considerations for ``if TYPE_CHECKING:``
------------------------------------------------
Expand Down
18 changes: 17 additions & 1 deletion docs/versionhistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,25 @@ This library adheres to

**UNRELEASED**

- Dropped Python 3.8 support
- Changed the signature of ``typeguard_ignore()`` to be compatible with
``typing.no_type_check()`` (PR by @jolaf)
- Avoid creating reference cycles when type checking uniontypes and classes
- Fixed checking of variable assignments involving tuple unpacking
(`#486 <https://github.com/agronholm/typeguard/pull/486>`_)
- Fixed ``TypeError`` when checking a class against ``type[Self]``
(`#481 <https://github.com/agronholm/typeguard/pull/481>`_)
- Fixed checking of protocols on the class level (against ``type[SomeProtocol]``)
(`#498 <https://github.com/agronholm/typeguard/pull/498>`_)

**4.4.0** (2024-10-27)

- Added proper checking for method signatures in protocol checks
(`#465 <https://github.com/agronholm/typeguard/pull/465>`_)
- Fixed basic support for intersection protocols
(`#490 <https://github.com/agronholm/typeguard/pull/490>`_; PR by @antonagestam)
- Avoid creating reference cycles when type checking uniontypes and classes
- Fixed protocol checks running against the class of an instance and not the instance
itself (this produced wrong results for non-method member checks)

**4.3.0** (2024-05-27)

Expand Down
34 changes: 16 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
requires-python = ">= 3.8"
requires-python = ">= 3.9"
dependencies = [
"importlib_metadata >= 3.6; python_version < '3.10'",
"typing_extensions >= 4.10.0",
Expand Down Expand Up @@ -80,36 +80,34 @@ src = ["src"]

[tool.ruff.lint]
extend-select = [
"W", # pycodestyle warnings
"B0", # flake8-bugbear
"I", # isort
"PGH", # pygrep-hooks
"UP", # pyupgrade
"B0", # flake8-bugbear
"W", # pycodestyle warnings
]
ignore = [
"S307",
"B008",
"UP006",
"UP035",
]

[tool.mypy]
python_version = "3.9"
python_version = "3.11"
strict = true
pretty = true

[tool.tox]
legacy_tox_ini = """
[tox]
envlist = pypy3, py38, py39, py310, py311, py312, py313
env_list = ["py39", "py310", "py311", "py312", "py313"]
skip_missing_interpreters = true
minversion = 4.0

[testenv]
extras = test
commands = coverage run -m pytest {posargs}
package = editable
[tool.tox.env_run_base]
commands = [["coverage", "run", "-m", "pytest", { replace = "posargs", extend = true }]]
package = "editable"
extras = ["test"]

[testenv:docs]
extras = doc
package = editable
commands = sphinx-build -W -n docs build/sphinx
"""
[tool.tox.env.docs]
depends = []
extras = ["doc"]
commands = [["sphinx-build", "-W", "-n", "docs", "build/sphinx"]]
Loading

0 comments on commit 3699518

Please sign in to comment.