temparse 0.0.5__tar.gz → 1.0.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: temparse
3
- Version: 0.0.5
3
+ Version: 1.0.0
4
4
  Summary: temparse is template + parse
5
5
  Author: jiang-zhexin
6
6
  Author-email: jiang-zhexin <162887873+jiang-zhexin@users.noreply.github.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "temparse"
3
- version = "0.0.5"
3
+ version = "1.0.0"
4
4
  description = "temparse is template + parse"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.14"
@@ -23,9 +23,9 @@ homepage = "https://github.com/jiang-zhexin/temparse"
23
23
 
24
24
  [dependency-groups]
25
25
  dev = [
26
- "pytest>=9.0.3",
27
- "ruff>=0.15.15",
28
- "ty>=0.0.43",
26
+ "pytest>=9.1.1",
27
+ "ruff>=0.15.22",
28
+ "ty>=0.0.61",
29
29
  ]
30
30
 
31
31
  [build-system]
@@ -4,7 +4,7 @@ import json
4
4
  import re
5
5
  from collections.abc import Callable
6
6
  from string.templatelib import Interpolation, Template
7
- from typing import Any, final, get_origin, is_typeddict
7
+ from typing import Any, cast, final, get_origin, is_typeddict
8
8
 
9
9
  __all__ = ["Conversion", "FormatConversion", "Parser", "parse"]
10
10
 
@@ -41,9 +41,14 @@ class Parser[*T]:
41
41
  if m is None:
42
42
  raise ValueError(f"invalid format: {s!r}")
43
43
 
44
- return tuple(
45
- _convert(text, interpolation)
46
- for text, interpolation in zip(m.groups(), self._template.interpolations)
44
+ return cast(
45
+ tuple[*T],
46
+ tuple(
47
+ _convert(text, interpolation)
48
+ for text, interpolation in zip(
49
+ m.groups(), self._template.interpolations
50
+ )
51
+ ),
47
52
  )
48
53
 
49
54
 
@@ -71,7 +76,7 @@ class parse[*T]:
71
76
  return Parser(t).parse(s)
72
77
  ```
73
78
  """
74
- return Parser(t, flags).parse(s)
79
+ return Parser[*T](t, flags).parse(s)
75
80
 
76
81
 
77
82
  @final
File without changes
File without changes