datarepr 1.2.7__tar.gz → 1.2.8__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.
@@ -0,0 +1,3 @@
1
+ recursive-include docs *.rst
2
+ recursive-include src *.toml
3
+ recursive-include tests *.toml
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datarepr
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: This project allows for common sense data representation.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License-Expression: MIT
@@ -28,7 +28,7 @@ license-files = [
28
28
  name = "datarepr"
29
29
  readme = "README.rst"
30
30
  requires-python = ">=3.11"
31
- version = "1.2.7"
31
+ version = "1.2.8"
32
32
 
33
33
  [project.urls]
34
34
  Download = "https://pypi.org/project/datarepr/#files"
@@ -1,5 +1,5 @@
1
1
  """Provide data representation utilities."""
2
2
 
3
- __all__ = ["datarepr", "oxford"]
3
+ __all__: list[str] = ["datarepr", "oxford"]
4
4
 
5
5
  from datarepr.core import datarepr, oxford
@@ -1,6 +1,6 @@
1
1
  """Provide core data representation utilities."""
2
2
 
3
- __all__ = ["datarepr", "oxford"]
3
+ __all__: list[str] = ["datarepr", "oxford"]
4
4
 
5
5
  from typing import TypeVar
6
6
 
@@ -1,6 +1,6 @@
1
1
  """Provide test utilities for the datarepr package."""
2
2
 
3
- __all__ = ["test"]
3
+ __all__: list[str] = ["test"]
4
4
 
5
5
  import unittest
6
6
 
@@ -1,6 +1,6 @@
1
1
  """Test the datarepr function."""
2
2
 
3
- __all__ = ["TestDatareprFunction"]
3
+ __all__: list[str] = ["TestDatareprFunction"]
4
4
 
5
5
  import enum
6
6
  import io
@@ -18,7 +18,7 @@ class Lazy(enum.Enum):
18
18
  lazy = None
19
19
 
20
20
  @cached_property
21
- def data(self: Self) -> dict[str, Any]:
21
+ def data(self: Self, /) -> dict[str, Any]:
22
22
  file: Path
23
23
  stream: io.BufferedReader
24
24
  file = Path(__file__).parent / "testdata.toml"
@@ -26,7 +26,7 @@ class Lazy(enum.Enum):
26
26
  return tomllib.load(stream)
27
27
 
28
28
  @cached_property
29
- def test_0(self: Self) -> dict[str, Any]:
29
+ def test_0(self: Self, /) -> dict[str, Any]:
30
30
  return cast(dict[str, Any], self.lazy.data["test_0"])
31
31
 
32
32
 
@@ -38,9 +38,9 @@ class TestDatareprFunction(unittest.TestCase):
38
38
  name: str,
39
39
  /,
40
40
  *,
41
- solution: str,
42
41
  args: Sequence[Any],
43
42
  kwargs: Any = (),
43
+ solution: str,
44
44
  ) -> None:
45
45
  """Test the datarepr function with valid parameters."""
46
46
  result: str
@@ -48,12 +48,14 @@ class TestDatareprFunction(unittest.TestCase):
48
48
  result = datarepr(*args, **dict(kwargs))
49
49
  self.assertEqual(result, solution)
50
50
 
51
- def test_0(self: Self) -> None:
51
+ def test_0(self: Self, /) -> None:
52
52
  """Test the testdata."""
53
+ x: Any
54
+ y: Any
53
55
  for x, y in Lazy.lazy.test_0.items():
54
56
  self.go_valid(x, **y)
55
57
 
56
- def test_combination_of_all(self: Self) -> None:
58
+ def test_combination_of_all(self: Self, /) -> None:
57
59
  """Test a complex combination of types and structures."""
58
60
  result: str
59
61
  solution: str
@@ -71,13 +73,13 @@ class TestDatareprFunction(unittest.TestCase):
71
73
  )
72
74
  self.assertEqual(result, solution)
73
75
 
74
- def test_name_as_non_string(self: Self) -> None:
76
+ def test_name_as_non_string(self: Self, /) -> None:
75
77
  """Test with the 'name' parameter as a non-string type."""
76
78
  result: str
77
79
  result = datarepr(None, "arg1")
78
80
  self.assertEqual(result, "None('arg1')")
79
81
 
80
- def test_no_args_at_all(self: Self) -> None:
82
+ def test_no_args_at_all(self: Self, /) -> None:
81
83
  """Test with no arguments, not even the name."""
82
84
  args: Any
83
85
  args = ()
@@ -85,7 +87,7 @@ class TestDatareprFunction(unittest.TestCase):
85
87
  # Raise TypeError: missing required 'name' argument.
86
88
  datarepr(*args)
87
89
 
88
- def test_special_characters(self: Self) -> None:
90
+ def test_special_characters(self: Self, /) -> None:
89
91
  """Test with special characters in arguments."""
90
92
  result: str
91
93
  result = datarepr("test_function", "a\nb", "\t", key="val\nue")
@@ -93,7 +95,7 @@ class TestDatareprFunction(unittest.TestCase):
93
95
  result, "test_function('a\\nb', '\\t', key='val\\nue')"
94
96
  )
95
97
 
96
- def test_various_types(self: Self) -> None:
98
+ def test_various_types(self: Self, /) -> None:
97
99
  """Test with various types of arguments."""
98
100
  result: str
99
101
  result = datarepr("test_function", 1, 2.0, True, None)
@@ -1,6 +1,6 @@
1
1
  """Test the oxford function."""
2
2
 
3
- __all__ = ["TestOxfordFunction"]
3
+ __all__: list[str] = ["TestOxfordFunction"]
4
4
 
5
5
  import unittest
6
6
  from typing import Self
@@ -11,7 +11,7 @@ from datarepr.core import oxford
11
11
  class TestOxfordFunction(unittest.TestCase):
12
12
  """Test the oxford function comprehensively."""
13
13
 
14
- def test_no_args_at_all(self: Self) -> None:
14
+ def test_no_args_at_all(self: Self, /) -> None:
15
15
  """Test oxford with varying numbers of arguments."""
16
16
  self.assertEqual("", oxford())
17
17
  self.assertEqual(42, oxford(default=42))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datarepr
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: This project allows for common sense data representation.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License-Expression: MIT
@@ -1,2 +0,0 @@
1
- recursive-include docs *.rst
2
- recursive-include src/datarepr *.toml
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes