preparse 1.1.3__tar.gz → 1.1.4__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.
- {preparse-1.1.3 → preparse-1.1.4}/PKG-INFO +1 -1
- {preparse-1.1.3 → preparse-1.1.4}/pyproject.toml +1 -10
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_processing/__init__.py +3 -2
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_processing/parsing.py +6 -5
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_processing/pulling.py +4 -3
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/core/Optdict.py +2 -2
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/core/PreParser.py +7 -6
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/tests/test_data_toml.py +6 -6
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/tests/test_enums.py +1 -1
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/tests/test_expit_toml.py +6 -6
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/tests/test_optdict.py +1 -1
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/tests/test_preparser.py +2 -2
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse.egg-info/PKG-INFO +1 -1
- {preparse-1.1.3 → preparse-1.1.4}/LICENSE.txt +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/MANIFEST.in +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/README.rst +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/docs/v1.0.rst +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/docs/v1.1.rst +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/setup.cfg +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/__init__.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_items/Bundle.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_items/Item.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_items/Long.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_items/Option.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_items/Positional.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_items/Special.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_items/__init__.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_processing/deparsing.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_processing/digesting.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_tests/__init__.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_tests/expit.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_utils/__init__.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/_utils/dataprop.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/core/Click.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/core/__init__.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/core/enums.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/core/warnings.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/py.typed +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/tests/__init__.py +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/tests/data.toml +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse/tests/expit.toml +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse.egg-info/SOURCES.txt +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse.egg-info/dependency_links.txt +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse.egg-info/requires.txt +0 -0
- {preparse-1.1.3 → preparse-1.1.4}/src/preparse.egg-info/top_level.txt +0 -0
|
@@ -36,7 +36,7 @@ license-files = [
|
|
|
36
36
|
name = "preparse"
|
|
37
37
|
readme = "README.rst"
|
|
38
38
|
requires-python = ">=3.11"
|
|
39
|
-
version = "1.1.
|
|
39
|
+
version = "1.1.4"
|
|
40
40
|
|
|
41
41
|
[project.urls]
|
|
42
42
|
Download = "https://pypi.org/project/preparse/#files"
|
|
@@ -50,12 +50,3 @@ files = [
|
|
|
50
50
|
]
|
|
51
51
|
python_version = "3.11"
|
|
52
52
|
strict = false
|
|
53
|
-
|
|
54
|
-
[[tool.mypy.overrides]]
|
|
55
|
-
module = [
|
|
56
|
-
"cmp3",
|
|
57
|
-
"cmp3.*",
|
|
58
|
-
"datahold",
|
|
59
|
-
"datahold.*",
|
|
60
|
-
]
|
|
61
|
-
ignore_missing_imports = true
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
from collections.abc import Iterable
|
|
1
2
|
from types import FunctionType
|
|
2
|
-
from typing import
|
|
3
|
+
from typing import Optional
|
|
3
4
|
|
|
4
5
|
from preparse._items import *
|
|
5
6
|
from preparse._processing.deparsing import *
|
|
@@ -13,7 +14,7 @@ __all__ = ["process"]
|
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
def process(
|
|
16
|
-
args: Optional[Iterable] = None,
|
|
17
|
+
args: Optional[Iterable[object]] = None,
|
|
17
18
|
*,
|
|
18
19
|
allowslong: bool,
|
|
19
20
|
allowsshort: bool,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
from collections.abc import Iterable
|
|
1
2
|
from types import FunctionType
|
|
2
|
-
from typing import
|
|
3
|
+
from typing import Any, Generator
|
|
3
4
|
|
|
4
5
|
from preparse._items.Bundle import Bundle
|
|
5
6
|
from preparse._items.Item import Item
|
|
@@ -26,7 +27,7 @@ def parse_bundling(
|
|
|
26
27
|
arg: str,
|
|
27
28
|
*,
|
|
28
29
|
cause: FunctionType,
|
|
29
|
-
optdict: dict,
|
|
30
|
+
optdict: dict[Any, Any],
|
|
30
31
|
) -> Bundle:
|
|
31
32
|
ans: Bundle
|
|
32
33
|
x: int
|
|
@@ -67,7 +68,7 @@ def parse_generator(
|
|
|
67
68
|
allowsshort: bool,
|
|
68
69
|
expectsabbr: bool,
|
|
69
70
|
expectsposix: bool,
|
|
70
|
-
optdict: dict,
|
|
71
|
+
optdict: dict[Any, Any],
|
|
71
72
|
prog: str,
|
|
72
73
|
warn: FunctionType,
|
|
73
74
|
) -> Generator[Any, Any, Any]:
|
|
@@ -137,7 +138,7 @@ def parse_long(
|
|
|
137
138
|
*,
|
|
138
139
|
cause: FunctionType,
|
|
139
140
|
expectsabbr: bool,
|
|
140
|
-
optdict: dict,
|
|
141
|
+
optdict: dict[Any, Any],
|
|
141
142
|
) -> Long:
|
|
142
143
|
ans: Long
|
|
143
144
|
parts: list[str]
|
|
@@ -187,7 +188,7 @@ def parse_option(
|
|
|
187
188
|
*,
|
|
188
189
|
cause: FunctionType,
|
|
189
190
|
expectsabbr: bool,
|
|
190
|
-
optdict: dict,
|
|
191
|
+
optdict: dict[Any, Any],
|
|
191
192
|
**kwargs: Any,
|
|
192
193
|
) -> Option:
|
|
193
194
|
if parse_islong(arg, **kwargs):
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import sys
|
|
2
|
-
from
|
|
2
|
+
from collections.abc import Iterable
|
|
3
|
+
from typing import Optional
|
|
3
4
|
|
|
4
5
|
from preparse._items.Item import Item
|
|
5
6
|
from preparse._items.Positional import Positional
|
|
@@ -7,9 +8,9 @@ from preparse._items.Positional import Positional
|
|
|
7
8
|
__all__ = ["pull"]
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
def pull(args: Optional[Iterable] = None) -> list[Item]:
|
|
11
|
+
def pull(args: Optional[Iterable[object]] = None) -> list[Item]:
|
|
11
12
|
"This method acquires args."
|
|
12
|
-
argiter: Iterable
|
|
13
|
+
argiter: Iterable[object]
|
|
13
14
|
if args is None:
|
|
14
15
|
argiter = sys.argv[1:]
|
|
15
16
|
else:
|
|
@@ -3,7 +3,7 @@ from typing import Any, Optional, Self
|
|
|
3
3
|
import cmp3 # type: ignore
|
|
4
4
|
import datahold
|
|
5
5
|
import setdoc
|
|
6
|
-
from datarepr import datarepr
|
|
6
|
+
from datarepr import datarepr # type: ignore
|
|
7
7
|
from frozendict import frozendict
|
|
8
8
|
|
|
9
9
|
from preparse.core.enums import *
|
|
@@ -42,7 +42,7 @@ class Optdict(cmp3.CmpABC, datahold.HoldDict[str, Nargs]):
|
|
|
42
42
|
|
|
43
43
|
@data.setter
|
|
44
44
|
def data(self: Self, value: Any) -> None:
|
|
45
|
-
a: frozendict
|
|
45
|
+
a: frozendict[Any, Any]
|
|
46
46
|
x: map
|
|
47
47
|
y: map
|
|
48
48
|
a = frozendict(value)
|
|
@@ -3,13 +3,14 @@ from __future__ import annotations
|
|
|
3
3
|
import os
|
|
4
4
|
import sys
|
|
5
5
|
import types
|
|
6
|
-
from
|
|
6
|
+
from collections.abc import Iterable
|
|
7
|
+
from typing import Any, Callable, Optional, Self, cast
|
|
7
8
|
|
|
8
9
|
import click as cl
|
|
9
10
|
import setdoc
|
|
10
11
|
from copyable import Copyable
|
|
11
|
-
from datarepr import datarepr
|
|
12
|
-
from tofunc import tofunc
|
|
12
|
+
from datarepr import datarepr # type: ignore[attr-defined]
|
|
13
|
+
from tofunc import tofunc # type: ignore[attr-defined]
|
|
13
14
|
|
|
14
15
|
from preparse._processing import *
|
|
15
16
|
from preparse._utils.dataprop import dataprop
|
|
@@ -39,7 +40,7 @@ class PreParser(Copyable):
|
|
|
39
40
|
prog: Any = None,
|
|
40
41
|
reconcilesorders: Any = True,
|
|
41
42
|
special: Any = Tuning.MAINTAIN,
|
|
42
|
-
warn: Callable = str,
|
|
43
|
+
warn: Callable = str, # type: ignore[type-arg]
|
|
43
44
|
) -> None:
|
|
44
45
|
self._data: dict[str, Any]
|
|
45
46
|
self._data = dict()
|
|
@@ -104,11 +105,11 @@ class PreParser(Copyable):
|
|
|
104
105
|
dataA = Optdict(value)
|
|
105
106
|
self._data["optdict"].clear()
|
|
106
107
|
self._data["optdict"].update(dataA)
|
|
107
|
-
return self._data["optdict"]
|
|
108
|
+
return cast(Optdict, self._data["optdict"])
|
|
108
109
|
|
|
109
110
|
def parse_args(
|
|
110
111
|
self: Self,
|
|
111
|
-
args: Optional[Iterable] = None,
|
|
112
|
+
args: Optional[Iterable[object]] = None,
|
|
112
113
|
) -> list[str]:
|
|
113
114
|
"This method parses args."
|
|
114
115
|
return process(args, **self.todict())
|
|
@@ -35,7 +35,7 @@ class TestDataToml(unittest.TestCase):
|
|
|
35
35
|
def test_0(self: Self) -> None:
|
|
36
36
|
data: dict[str, Any]
|
|
37
37
|
name: str
|
|
38
|
-
kwargs: dict
|
|
38
|
+
kwargs: dict[str, Any]
|
|
39
39
|
data = Utils.utils.get_data()
|
|
40
40
|
for name, kwargs in data.items():
|
|
41
41
|
with self.subTest(msg=name, **kwargs):
|
|
@@ -49,12 +49,12 @@ class TestDataToml(unittest.TestCase):
|
|
|
49
49
|
warnings: Any,
|
|
50
50
|
**kwargs: Any,
|
|
51
51
|
) -> None:
|
|
52
|
-
answer: list
|
|
53
|
-
capture: list
|
|
54
|
-
data: dict
|
|
55
|
-
erranswer: list
|
|
52
|
+
answer: list[Any]
|
|
53
|
+
capture: list[Any]
|
|
54
|
+
data: dict[str, Any]
|
|
55
|
+
erranswer: list[Any]
|
|
56
56
|
msg: str
|
|
57
|
-
superanswer: list
|
|
57
|
+
superanswer: list[Any]
|
|
58
58
|
parser: PreParser
|
|
59
59
|
capture = list()
|
|
60
60
|
|
|
@@ -3,7 +3,7 @@ import math
|
|
|
3
3
|
import tomllib
|
|
4
4
|
import unittest
|
|
5
5
|
from importlib import resources
|
|
6
|
-
from typing import
|
|
6
|
+
from typing import Any, Self
|
|
7
7
|
|
|
8
8
|
from click.testing import CliRunner
|
|
9
9
|
|
|
@@ -17,8 +17,8 @@ class Utils(enum.Enum):
|
|
|
17
17
|
utils = None
|
|
18
18
|
|
|
19
19
|
@staticmethod
|
|
20
|
-
def get_data() -> dict:
|
|
21
|
-
data: dict
|
|
20
|
+
def get_data() -> dict[Any, Any]:
|
|
21
|
+
data: dict[Any, Any]
|
|
22
22
|
text: str
|
|
23
23
|
text = resources.read_text("preparse.tests", "expit.toml")
|
|
24
24
|
data = tomllib.loads(text)
|
|
@@ -45,7 +45,7 @@ class TestMainFunction(unittest.TestCase):
|
|
|
45
45
|
stdout: Any,
|
|
46
46
|
stderr: Any,
|
|
47
47
|
) -> None:
|
|
48
|
-
extra: dict
|
|
48
|
+
extra: dict[Any, Any]
|
|
49
49
|
result: Any
|
|
50
50
|
runner: CliRunner
|
|
51
51
|
runner = CliRunner()
|
|
@@ -65,8 +65,8 @@ class TestMainFunction(unittest.TestCase):
|
|
|
65
65
|
self.assertEqual(stderr, result.stderr)
|
|
66
66
|
|
|
67
67
|
def test_0(self: Self) -> None:
|
|
68
|
-
data: dict
|
|
69
|
-
kwargs: dict
|
|
68
|
+
data: dict[Any, Any]
|
|
69
|
+
kwargs: dict[Any, Any]
|
|
70
70
|
name: str
|
|
71
71
|
data = Utils.utils.get_data()
|
|
72
72
|
for name, kwargs in data.items():
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import unittest
|
|
2
|
-
from typing import
|
|
2
|
+
from typing import Any, Self
|
|
3
3
|
|
|
4
4
|
from preparse.core.Click import Click
|
|
5
5
|
from preparse.core.enums import *
|
|
@@ -29,7 +29,7 @@ class TestPreParser(unittest.TestCase):
|
|
|
29
29
|
self.assertEqual(parser.optdict, parser_copy.optdict)
|
|
30
30
|
|
|
31
31
|
def test_preparser_todict(self: Self) -> None:
|
|
32
|
-
expected_keys: list
|
|
32
|
+
expected_keys: list[Any]
|
|
33
33
|
parser: PreParser
|
|
34
34
|
result: Any
|
|
35
35
|
parser = PreParser()
|
|
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
|
|
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
|