typeguard 4.5.0__tar.gz → 4.5.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. {typeguard-4.5.0 → typeguard-4.5.2}/.github/workflows/publish.yml +2 -2
  2. {typeguard-4.5.0 → typeguard-4.5.2}/PKG-INFO +1 -1
  3. {typeguard-4.5.0 → typeguard-4.5.2}/docs/versionhistory.rst +12 -0
  4. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard/_checkers.py +2 -2
  5. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard/_functions.py +2 -1
  6. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard.egg-info/PKG-INFO +1 -1
  7. {typeguard-4.5.0 → typeguard-4.5.2}/tests/test_checkers.py +18 -0
  8. {typeguard-4.5.0 → typeguard-4.5.2}/tests/test_instrumentation.py +2 -2
  9. {typeguard-4.5.0 → typeguard-4.5.2}/.github/FUNDING.yml +0 -0
  10. {typeguard-4.5.0 → typeguard-4.5.2}/.github/ISSUE_TEMPLATE/bug_report.yaml +0 -0
  11. {typeguard-4.5.0 → typeguard-4.5.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  12. {typeguard-4.5.0 → typeguard-4.5.2}/.github/ISSUE_TEMPLATE/features_request.yaml +0 -0
  13. {typeguard-4.5.0 → typeguard-4.5.2}/.github/SECURITY.md +0 -0
  14. {typeguard-4.5.0 → typeguard-4.5.2}/.github/dependabot.yml +0 -0
  15. {typeguard-4.5.0 → typeguard-4.5.2}/.github/pull_request_template.md +0 -0
  16. {typeguard-4.5.0 → typeguard-4.5.2}/.github/workflows/test.yml +0 -0
  17. {typeguard-4.5.0 → typeguard-4.5.2}/.gitignore +0 -0
  18. {typeguard-4.5.0 → typeguard-4.5.2}/.pre-commit-config.yaml +0 -0
  19. {typeguard-4.5.0 → typeguard-4.5.2}/.readthedocs.yml +0 -0
  20. {typeguard-4.5.0 → typeguard-4.5.2}/LICENSE +0 -0
  21. {typeguard-4.5.0 → typeguard-4.5.2}/README.rst +0 -0
  22. {typeguard-4.5.0 → typeguard-4.5.2}/docs/api.rst +0 -0
  23. {typeguard-4.5.0 → typeguard-4.5.2}/docs/conf.py +0 -0
  24. {typeguard-4.5.0 → typeguard-4.5.2}/docs/contributing.rst +0 -0
  25. {typeguard-4.5.0 → typeguard-4.5.2}/docs/extending.rst +0 -0
  26. {typeguard-4.5.0 → typeguard-4.5.2}/docs/features.rst +0 -0
  27. {typeguard-4.5.0 → typeguard-4.5.2}/docs/index.rst +0 -0
  28. {typeguard-4.5.0 → typeguard-4.5.2}/docs/userguide.rst +0 -0
  29. {typeguard-4.5.0 → typeguard-4.5.2}/pyproject.toml +0 -0
  30. {typeguard-4.5.0 → typeguard-4.5.2}/setup.cfg +0 -0
  31. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard/__init__.py +0 -0
  32. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard/_config.py +0 -0
  33. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard/_decorators.py +0 -0
  34. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard/_exceptions.py +0 -0
  35. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard/_importhook.py +0 -0
  36. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard/_memo.py +0 -0
  37. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard/_pytest_plugin.py +0 -0
  38. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard/_suppression.py +0 -0
  39. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard/_transformer.py +0 -0
  40. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard/_utils.py +0 -0
  41. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard/py.typed +0 -0
  42. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard.egg-info/SOURCES.txt +0 -0
  43. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard.egg-info/dependency_links.txt +0 -0
  44. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard.egg-info/entry_points.txt +0 -0
  45. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard.egg-info/requires.txt +0 -0
  46. {typeguard-4.5.0 → typeguard-4.5.2}/src/typeguard.egg-info/top_level.txt +0 -0
  47. {typeguard-4.5.0 → typeguard-4.5.2}/tests/__init__.py +0 -0
  48. {typeguard-4.5.0 → typeguard-4.5.2}/tests/conftest.py +0 -0
  49. {typeguard-4.5.0 → typeguard-4.5.2}/tests/deferredannos.py +0 -0
  50. {typeguard-4.5.0 → typeguard-4.5.2}/tests/dummymodule.py +0 -0
  51. {typeguard-4.5.0 → typeguard-4.5.2}/tests/dummymodule_py312.py +0 -0
  52. {typeguard-4.5.0 → typeguard-4.5.2}/tests/mypy/negative.py +0 -0
  53. {typeguard-4.5.0 → typeguard-4.5.2}/tests/mypy/positive.py +0 -0
  54. {typeguard-4.5.0 → typeguard-4.5.2}/tests/mypy/test_type_annotations.py +0 -0
  55. {typeguard-4.5.0 → typeguard-4.5.2}/tests/test_functions.py +0 -0
  56. {typeguard-4.5.0 → typeguard-4.5.2}/tests/test_importhook.py +0 -0
  57. {typeguard-4.5.0 → typeguard-4.5.2}/tests/test_plugins.py +0 -0
  58. {typeguard-4.5.0 → typeguard-4.5.2}/tests/test_pytest_plugin.py +0 -0
  59. {typeguard-4.5.0 → typeguard-4.5.2}/tests/test_suppression.py +0 -0
  60. {typeguard-4.5.0 → typeguard-4.5.2}/tests/test_transformer.py +0 -0
  61. {typeguard-4.5.0 → typeguard-4.5.2}/tests/test_typechecked.py +0 -0
  62. {typeguard-4.5.0 → typeguard-4.5.2}/tests/test_utils.py +0 -0
  63. {typeguard-4.5.0 → typeguard-4.5.2}/tests/test_warn_on_error.py +0 -0
@@ -24,7 +24,7 @@ jobs:
24
24
  - name: Create packages
25
25
  run: python -m build
26
26
  - name: Archive packages
27
- uses: actions/upload-artifact@v6
27
+ uses: actions/upload-artifact@v7
28
28
  with:
29
29
  name: dist
30
30
  path: dist
@@ -38,7 +38,7 @@ jobs:
38
38
  id-token: write
39
39
  steps:
40
40
  - name: Retrieve packages
41
- uses: actions/download-artifact@v7
41
+ uses: actions/download-artifact@v8
42
42
  with:
43
43
  name: dist
44
44
  path: dist
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: typeguard
3
- Version: 4.5.0
3
+ Version: 4.5.2
4
4
  Summary: Run-time type checker for Python
5
5
  Author-email: Alex Grönholm <alex.gronholm@nextday.fi>
6
6
  License-Expression: MIT
@@ -4,6 +4,18 @@ Version history
4
4
  This library adheres to
5
5
  `Semantic Versioning 2.0 <https://semver.org/#semantic-versioning-200>`_.
6
6
 
7
+ **4.5.2** (2026-05-14)
8
+
9
+ - Fixed ``IndexError`` raised from ``check_signature_compatible`` when the subject
10
+ method has no positional parameters
11
+ (`#550 <https://github.com/agronholm/typeguard/issues/550>`_; PR by @HackedRico)
12
+
13
+ **4.5.1** (2026-02-19)
14
+
15
+ - Fixed iterable unpacking incorrectly calculating the cut-off offset of the item list
16
+ when assigning remaining values to the star variable
17
+ (`#546 <https://github.com/agronholm/typeguard/issues/546>`_)
18
+
7
19
  **4.5.0** (2026-02-15)
8
20
 
9
21
  - Restored the ``check_argument_types()`` and ``check_return_type()`` functions that
@@ -761,11 +761,11 @@ def check_signature_compatible(subject: type, protocol: type, attrname: str) ->
761
761
  ]
762
762
 
763
763
  # Remove the "self" parameter from the protocol arguments to match
764
- if protocol_type == "instance":
764
+ if protocol_type == "instance" and protocol_args:
765
765
  protocol_args.pop(0)
766
766
 
767
767
  # Remove the "self" parameter from the subject arguments to match
768
- if subject_type == "instance":
768
+ if subject_type == "instance" and subject_args:
769
769
  subject_args.pop(0)
770
770
 
771
771
  for protocol_arg, subject_arg in zip_longest(protocol_args, subject_args):
@@ -328,7 +328,8 @@ def check_variable_assignment(
328
328
  for index, (name, annotation) in enumerate(targets):
329
329
  if name.startswith("*"):
330
330
  remaining_values = list(iterator)
331
- cutoff_offset = len(targets) - index
331
+ num_remaining_targets = len(targets) - 1 - index
332
+ cutoff_offset = len(remaining_values) - num_remaining_targets
332
333
  star_values = remaining_values[:cutoff_offset]
333
334
  iterator = iter(remaining_values[cutoff_offset:])
334
335
  values_to_check.append((star_values, name[1:], annotation))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: typeguard
3
- Version: 4.5.0
3
+ Version: 4.5.2
4
4
  Summary: Run-time type checker for Python
5
5
  Author-email: Alex Grönholm <alex.gronholm@nextday.fi>
6
6
  License-Expression: MIT
@@ -1404,6 +1404,24 @@ class TestProtocol:
1404
1404
  f"few positional arguments"
1405
1405
  )
1406
1406
 
1407
+ def test_subject_method_no_positional_params(self) -> None:
1408
+ class ZeroArg:
1409
+ def __call__(self) -> None:
1410
+ return None
1411
+
1412
+ class MyProtocol(Protocol):
1413
+ def meth(self, x: str) -> None:
1414
+ pass
1415
+
1416
+ class Foo:
1417
+ meth = ZeroArg()
1418
+
1419
+ pytest.raises(TypeCheckError, check_type, Foo(), MyProtocol).match(
1420
+ f"^{qualified_name(Foo)} is not compatible with the "
1421
+ f"{MyProtocol.__qualname__} protocol because its 'meth' method has too "
1422
+ f"few positional arguments"
1423
+ )
1424
+
1407
1425
  def test_no_varargs(self) -> None:
1408
1426
  class MyProtocol(Protocol):
1409
1427
  def meth(self, *args: Any) -> None:
@@ -280,10 +280,10 @@ def test_unpacking_assign_star_with_annotation(dummymodule):
280
280
 
281
281
  def test_unpacking_assign_star_no_annotation_success(dummymodule):
282
282
  assert dummymodule.unpacking_assign_star_no_annotation(
283
- (1, b"abc", b"bah", "foo")
283
+ (1, b"abc", b"bah", b"xyzzy", b"1234", "foo")
284
284
  ) == (
285
285
  1,
286
- [b"abc", b"bah"],
286
+ [b"abc", b"bah", b"xyzzy", b"1234"],
287
287
  "foo",
288
288
  )
289
289
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes