annotate 2.4.6__tar.gz → 2.5.1__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 (30) hide show
  1. {annotate-2.4.6 → annotate-2.5.1}/CHANGES.rst +3 -2
  2. {annotate-2.4.6/src/annotate.egg-info → annotate-2.5.1}/PKG-INFO +10 -10
  3. {annotate-2.4.6 → annotate-2.5.1}/README.rst +8 -8
  4. {annotate-2.4.6 → annotate-2.5.1}/pyproject.toml +2 -2
  5. annotate-2.5.1/src/annotate/__about__.py +6 -0
  6. {annotate-2.4.6 → annotate-2.5.1}/src/annotate/__init__.py +6 -2
  7. {annotate-2.4.6 → annotate-2.5.1}/src/annotate/_annotate.py +4 -2
  8. {annotate-2.4.6 → annotate-2.5.1/src/annotate.egg-info}/PKG-INFO +10 -10
  9. {annotate-2.4.6 → annotate-2.5.1}/src/annotate.egg-info/requires.txt +1 -1
  10. {annotate-2.4.6 → annotate-2.5.1}/tests/__init__.py +3 -1
  11. {annotate-2.4.6 → annotate-2.5.1}/tests/__main__.py +3 -1
  12. annotate-2.5.1/tests/test_main.py +75 -0
  13. annotate-2.4.6/src/annotate/__about__.py +0 -4
  14. annotate-2.4.6/tests/test_main.py +0 -73
  15. {annotate-2.4.6 → annotate-2.5.1}/LICENSE +0 -0
  16. {annotate-2.4.6 → annotate-2.5.1}/MANIFEST.in +0 -0
  17. {annotate-2.4.6 → annotate-2.5.1}/docs/CHANGES.rst +0 -0
  18. {annotate-2.4.6 → annotate-2.5.1}/docs/README.rst +0 -0
  19. {annotate-2.4.6 → annotate-2.5.1}/docs/_static/.keep +0 -0
  20. {annotate-2.4.6 → annotate-2.5.1}/docs/_templates/.keep +0 -0
  21. {annotate-2.4.6 → annotate-2.5.1}/docs/conf.py +0 -0
  22. {annotate-2.4.6 → annotate-2.5.1}/docs/index.rst +0 -0
  23. {annotate-2.4.6 → annotate-2.5.1}/noxfile.py +0 -0
  24. {annotate-2.4.6 → annotate-2.5.1}/setup.cfg +0 -0
  25. {annotate-2.4.6 → annotate-2.5.1}/src/annotate/py.typed +0 -0
  26. {annotate-2.4.6 → annotate-2.5.1}/src/annotate.egg-info/SOURCES.txt +0 -0
  27. {annotate-2.4.6 → annotate-2.5.1}/src/annotate.egg-info/dependency_links.txt +0 -0
  28. {annotate-2.4.6 → annotate-2.5.1}/src/annotate.egg-info/top_level.txt +0 -0
  29. {annotate-2.4.6 → annotate-2.5.1}/src/annotate.egg-info/zip-safe +0 -0
  30. {annotate-2.4.6 → annotate-2.5.1}/tests/data/.keep +0 -0
@@ -1,9 +1,10 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
- 2.4.6 (2026-10-05)
4
+ 2.5.1 (2026-10-15)
5
5
  ------------------
6
- - Added support for GraalPy 3.12
6
+ - Added support for GraalPy 3.13
7
+ - Cleanup and unification (better linting, typing etc).
7
8
 
8
9
  2.4.5 (2026-10-03)
9
10
  ------------------
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: annotate
3
- Version: 2.4.6
3
+ Version: 2.5.1
4
4
  Summary: Decorator to set a function's __annotations__ like Py3.
5
5
  Author-email: Adam Karpierz <adam@karpierz.net>
6
6
  Maintainer-email: Adam Karpierz <adam@karpierz.net>
@@ -34,7 +34,7 @@ Requires-Python: <4.0.0,>=3.11.0
34
34
  Description-Content-Type: text/x-rst; charset=UTF-8
35
35
  License-File: LICENSE
36
36
  Requires-Dist: typing-extensions>=4.16.0
37
- Requires-Dist: pkg-about>=2.4.6
37
+ Requires-Dist: pkg-about>=2.5.0
38
38
  Dynamic: license-file
39
39
 
40
40
  annotate
@@ -74,20 +74,20 @@ Examples
74
74
  """Java Array"""
75
75
 
76
76
  @classmethod
77
- @annotate('JArray', size=Union[int, long])
77
+ @annotate("JArray", size=Union[int, long])
78
78
  def newBooleanArray(cls, size):
79
79
  ...
80
80
  ...
81
81
  @classmethod
82
- @annotate('JArray', size=Union[int, long])
82
+ @annotate("JArray", size=Union[int, long])
83
83
  def newDoubleArray(cls, size):
84
84
  ...
85
85
  @classmethod
86
- @annotate('JArray', size=Union[int, long])
86
+ @annotate("JArray", size=Union[int, long])
87
87
  def newStringArray(cls, size):
88
88
  ...
89
89
  @classmethod
90
- @annotate('JArray', size=Union[int, long], component_class=JClass)
90
+ @annotate("JArray", size=Union[int, long], component_class=JClass)
91
91
  def newObjectArray(cls, size, component_class):
92
92
  ...
93
93
 
@@ -144,17 +144,17 @@ Examples
144
144
  def setObject(self, idx, val):
145
145
  ...
146
146
 
147
- @annotate('JArray', start=int, stop=int, step=int)
147
+ @annotate("JArray", start=int, stop=int, step=int)
148
148
  def getBooleanSlice(self, start, stop, step):
149
149
  ...
150
150
  ...
151
- @annotate('JArray', start=int, stop=int, step=int)
151
+ @annotate("JArray", start=int, stop=int, step=int)
152
152
  def getDoubleSlice(self, start, stop, step):
153
153
  ...
154
- @annotate('JArray', start=int, stop=int, step=int)
154
+ @annotate("JArray", start=int, stop=int, step=int)
155
155
  def getStringSlice(self, start, stop, step):
156
156
  ...
157
- @annotate('JArray', start=int, stop=int, step=int)
157
+ @annotate("JArray", start=int, stop=int, step=int)
158
158
  def getObjectSlice(self, start, stop, step):
159
159
  ...
160
160
 
@@ -35,20 +35,20 @@ Examples
35
35
  """Java Array"""
36
36
 
37
37
  @classmethod
38
- @annotate('JArray', size=Union[int, long])
38
+ @annotate("JArray", size=Union[int, long])
39
39
  def newBooleanArray(cls, size):
40
40
  ...
41
41
  ...
42
42
  @classmethod
43
- @annotate('JArray', size=Union[int, long])
43
+ @annotate("JArray", size=Union[int, long])
44
44
  def newDoubleArray(cls, size):
45
45
  ...
46
46
  @classmethod
47
- @annotate('JArray', size=Union[int, long])
47
+ @annotate("JArray", size=Union[int, long])
48
48
  def newStringArray(cls, size):
49
49
  ...
50
50
  @classmethod
51
- @annotate('JArray', size=Union[int, long], component_class=JClass)
51
+ @annotate("JArray", size=Union[int, long], component_class=JClass)
52
52
  def newObjectArray(cls, size, component_class):
53
53
  ...
54
54
 
@@ -105,17 +105,17 @@ Examples
105
105
  def setObject(self, idx, val):
106
106
  ...
107
107
 
108
- @annotate('JArray', start=int, stop=int, step=int)
108
+ @annotate("JArray", start=int, stop=int, step=int)
109
109
  def getBooleanSlice(self, start, stop, step):
110
110
  ...
111
111
  ...
112
- @annotate('JArray', start=int, stop=int, step=int)
112
+ @annotate("JArray", start=int, stop=int, step=int)
113
113
  def getDoubleSlice(self, start, stop, step):
114
114
  ...
115
- @annotate('JArray', start=int, stop=int, step=int)
115
+ @annotate("JArray", start=int, stop=int, step=int)
116
116
  def getStringSlice(self, start, stop, step):
117
117
  ...
118
- @annotate('JArray', start=int, stop=int, step=int)
118
+ @annotate("JArray", start=int, stop=int, step=int)
119
119
  def getObjectSlice(self, start, stop, step):
120
120
  ...
121
121
 
@@ -7,7 +7,7 @@ requires = [ "setuptools>=81.0.0", "packaging>=26.3.0" ]
7
7
 
8
8
  [project]
9
9
  name = "annotate"
10
- version = "2.4.6"
10
+ version = "2.5.1"
11
11
  description = "Decorator to set a function's __annotations__ like Py3."
12
12
  keywords = [ "annotate", "typing", "decorator" ]
13
13
  license = "Zlib"
@@ -51,7 +51,7 @@ dynamic = [ "readme" ]
51
51
  dependencies = [
52
52
  # mandatory
53
53
  "typing-extensions>=4.16.0",
54
- "pkg-about>=2.4.6",
54
+ "pkg-about>=2.5.0",
55
55
  # others
56
56
  ]
57
57
 
@@ -0,0 +1,6 @@
1
+ # Copyright (c) 2020 Adam Karpierz
2
+ # SPDX-License-Identifier: Zlib
3
+
4
+ from __future__ import annotations
5
+
6
+ __import__("pkg_about").about()
@@ -1,6 +1,10 @@
1
+ # flake8-in-file-ignores: noqa: F401,F403,F821
2
+
1
3
  # Copyright (c) 2012 Adam Karpierz
2
4
  # SPDX-License-Identifier: Zlib
3
5
 
4
- from .__about__ import * ; del __about__ # type: ignore[name-defined] # noqa
6
+ from __future__ import annotations
7
+
8
+ from .__about__ import * ; del __about__ # type: ignore[name-defined]
5
9
 
6
- from ._annotate import * ; del _annotate # type: ignore[name-defined] # noqa
10
+ from ._annotate import * ; del _annotate # type: ignore[name-defined]
@@ -1,11 +1,13 @@
1
1
  # Copyright (c) 2012 Adam Karpierz
2
2
  # SPDX-License-Identifier: Zlib
3
3
 
4
+ from __future__ import annotations
5
+
6
+ __all__ = ("annotate",)
7
+
4
8
  from typing import TypeAlias, Any
5
9
  from collections.abc import Callable
6
10
 
7
- __all__ = ('annotate',)
8
-
9
11
  AnyCallable: TypeAlias = Callable[..., Any]
10
12
 
11
13
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: annotate
3
- Version: 2.4.6
3
+ Version: 2.5.1
4
4
  Summary: Decorator to set a function's __annotations__ like Py3.
5
5
  Author-email: Adam Karpierz <adam@karpierz.net>
6
6
  Maintainer-email: Adam Karpierz <adam@karpierz.net>
@@ -34,7 +34,7 @@ Requires-Python: <4.0.0,>=3.11.0
34
34
  Description-Content-Type: text/x-rst; charset=UTF-8
35
35
  License-File: LICENSE
36
36
  Requires-Dist: typing-extensions>=4.16.0
37
- Requires-Dist: pkg-about>=2.4.6
37
+ Requires-Dist: pkg-about>=2.5.0
38
38
  Dynamic: license-file
39
39
 
40
40
  annotate
@@ -74,20 +74,20 @@ Examples
74
74
  """Java Array"""
75
75
 
76
76
  @classmethod
77
- @annotate('JArray', size=Union[int, long])
77
+ @annotate("JArray", size=Union[int, long])
78
78
  def newBooleanArray(cls, size):
79
79
  ...
80
80
  ...
81
81
  @classmethod
82
- @annotate('JArray', size=Union[int, long])
82
+ @annotate("JArray", size=Union[int, long])
83
83
  def newDoubleArray(cls, size):
84
84
  ...
85
85
  @classmethod
86
- @annotate('JArray', size=Union[int, long])
86
+ @annotate("JArray", size=Union[int, long])
87
87
  def newStringArray(cls, size):
88
88
  ...
89
89
  @classmethod
90
- @annotate('JArray', size=Union[int, long], component_class=JClass)
90
+ @annotate("JArray", size=Union[int, long], component_class=JClass)
91
91
  def newObjectArray(cls, size, component_class):
92
92
  ...
93
93
 
@@ -144,17 +144,17 @@ Examples
144
144
  def setObject(self, idx, val):
145
145
  ...
146
146
 
147
- @annotate('JArray', start=int, stop=int, step=int)
147
+ @annotate("JArray", start=int, stop=int, step=int)
148
148
  def getBooleanSlice(self, start, stop, step):
149
149
  ...
150
150
  ...
151
- @annotate('JArray', start=int, stop=int, step=int)
151
+ @annotate("JArray", start=int, stop=int, step=int)
152
152
  def getDoubleSlice(self, start, stop, step):
153
153
  ...
154
- @annotate('JArray', start=int, stop=int, step=int)
154
+ @annotate("JArray", start=int, stop=int, step=int)
155
155
  def getStringSlice(self, start, stop, step):
156
156
  ...
157
- @annotate('JArray', start=int, stop=int, step=int)
157
+ @annotate("JArray", start=int, stop=int, step=int)
158
158
  def getObjectSlice(self, start, stop, step):
159
159
  ...
160
160
 
@@ -1,2 +1,2 @@
1
1
  typing-extensions>=4.16.0
2
- pkg-about>=2.4.6
2
+ pkg-about>=2.5.0
@@ -1,7 +1,9 @@
1
1
  # Copyright (c) 1994 Adam Karpierz
2
2
  # SPDX-License-Identifier: Zlib
3
3
 
4
- __all__ = ('top_dir', 'test_dir')
4
+ from __future__ import annotations
5
+
6
+ __all__ = ("top_dir", "test_dir")
5
7
 
6
8
  import sys, pathlib
7
9
  sys.dont_write_bytecode = True
@@ -1,6 +1,8 @@
1
- # Copyright (c) 2012 Adam Karpierz
1
+ # Copyright (c) 1994 Adam Karpierz
2
2
  # SPDX-License-Identifier: Zlib
3
3
 
4
+ from __future__ import annotations
5
+
4
6
  import unittest
5
7
  import sys
6
8
  import logging
@@ -0,0 +1,75 @@
1
+ # Copyright (c) 2012 Adam Karpierz
2
+ # SPDX-License-Identifier: Zlib
3
+
4
+ from __future__ import annotations
5
+
6
+ import unittest
7
+
8
+ import annotate
9
+ from annotate import annotate
10
+
11
+
12
+ class JArray:
13
+ """Java Array"""
14
+
15
+ @classmethod
16
+ @annotate("JArray", size=int)
17
+ def newBooleanArray(cls, size):
18
+ ...
19
+
20
+ @annotate(borrowed=bool)
21
+ def __init__(self, borrowed=False):
22
+ ...
23
+
24
+ @annotate(int)
25
+ def getLength(self):
26
+ ...
27
+
28
+ @annotate(bool, idx=int)
29
+ def getBoolean(self, idx):
30
+ ...
31
+
32
+ @annotate(int, idx=int)
33
+ def getInt(self, idx, val):
34
+ ...
35
+
36
+ @annotate(float, idx=int)
37
+ def getDouble(self, idx):
38
+ ...
39
+
40
+ @annotate(str | None, idx=int)
41
+ def getString(self, idx):
42
+ ...
43
+
44
+ @annotate(idx=int, val=bool)
45
+ def setBoolean(self, idx, val):
46
+ ...
47
+
48
+ @annotate(idx=int, val=int)
49
+ def setInt(self, idx, val):
50
+ ...
51
+
52
+ @annotate(idx=int, val=float)
53
+ def setDouble(self, idx, val):
54
+ ...
55
+
56
+ @annotate(idx=int, val=str | None)
57
+ def setString(self, idx, val):
58
+ ...
59
+
60
+
61
+ class MainTestCase(unittest.TestCase):
62
+
63
+ def test_main(self):
64
+ self.assertEqual(JArray.newBooleanArray.__annotations__,
65
+ {"size": int, "return": "JArray"})
66
+ self.assertEqual(JArray.__init__.__annotations__, {"borrowed": bool})
67
+ self.assertEqual(JArray.getLength.__annotations__, {"return": int})
68
+ self.assertEqual(JArray.getBoolean.__annotations__, {"idx": int, "return": bool})
69
+ self.assertEqual(JArray.getInt.__annotations__, {"idx": int, "return": int})
70
+ self.assertEqual(JArray.getDouble.__annotations__, {"idx": int, "return": float})
71
+ self.assertEqual(JArray.getString.__annotations__, {"idx": int, "return": str | None})
72
+ self.assertEqual(JArray.setBoolean.__annotations__, {"idx": int, "val": bool})
73
+ self.assertEqual(JArray.setInt.__annotations__, {"idx": int, "val": int})
74
+ self.assertEqual(JArray.setDouble.__annotations__, {"idx": int, "val": float})
75
+ self.assertEqual(JArray.setString.__annotations__, {"idx": int, "val": str | None})
@@ -1,4 +0,0 @@
1
- # Copyright (c) 2012 Adam Karpierz
2
- # SPDX-License-Identifier: Zlib
3
-
4
- __import__("pkg_about").about()
@@ -1,73 +0,0 @@
1
- # Copyright (c) 2012 Adam Karpierz
2
- # SPDX-License-Identifier: Zlib
3
-
4
- import unittest
5
- from typing import Optional, Union
6
-
7
- import annotate
8
- from annotate import annotate
9
-
10
-
11
- class JArray:
12
- """Java Array"""
13
-
14
- @classmethod
15
- @annotate('JArray', size=int)
16
- def newBooleanArray(cls, size):
17
- ...
18
-
19
- @annotate(borrowed=bool)
20
- def __init__(self, borrowed=False):
21
- ...
22
-
23
- @annotate(int)
24
- def getLength(self):
25
- ...
26
-
27
- @annotate(bool, idx=int)
28
- def getBoolean(self, idx):
29
- ...
30
-
31
- @annotate(int, idx=int)
32
- def getInt(self, idx, val):
33
- ...
34
-
35
- @annotate(float, idx=int)
36
- def getDouble(self, idx):
37
- ...
38
-
39
- @annotate(Optional[str], idx=int)
40
- def getString(self, idx):
41
- ...
42
-
43
- @annotate(idx=int, val=bool)
44
- def setBoolean(self, idx, val):
45
- ...
46
-
47
- @annotate(idx=int, val=int)
48
- def setInt(self, idx, val):
49
- ...
50
-
51
- @annotate(idx=int, val=float)
52
- def setDouble(self, idx, val):
53
- ...
54
-
55
- @annotate(idx=int, val=Optional[str])
56
- def setString(self, idx, val):
57
- ...
58
-
59
-
60
- class MainTestCase(unittest.TestCase):
61
-
62
- def test_main(self):
63
- self.assertEqual(JArray.newBooleanArray.__annotations__, {"size": int, "return": "JArray"})
64
- self.assertEqual(JArray.__init__.__annotations__, {"borrowed": bool})
65
- self.assertEqual(JArray.getLength.__annotations__, {"return": int})
66
- self.assertEqual(JArray.getBoolean.__annotations__, {"idx": int, "return": bool})
67
- self.assertEqual(JArray.getInt.__annotations__, {"idx": int, "return": int})
68
- self.assertEqual(JArray.getDouble.__annotations__, {"idx": int, "return": float})
69
- self.assertEqual(JArray.getString.__annotations__, {"idx": int, "return": Optional[str]})
70
- self.assertEqual(JArray.setBoolean.__annotations__, {"idx": int, "val": bool})
71
- self.assertEqual(JArray.setInt.__annotations__, {"idx": int, "val": int})
72
- self.assertEqual(JArray.setDouble.__annotations__, {"idx": int, "val": float})
73
- self.assertEqual(JArray.setString.__annotations__, {"idx": int, "val": Optional[str]})
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