v440 2.0.0.dev78__tar.gz → 2.0.0.dev80__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.
- {v440-2.0.0.dev78/src/v440.egg-info → v440-2.0.0.dev80}/PKG-INFO +1 -1
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/pyproject.toml +1 -1
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/_utils/releaseparse/numerals.py +7 -13
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/core/Local.py +18 -4
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/core/Release.py +3 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80/src/v440.egg-info}/PKG-INFO +1 -1
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/LICENSE.txt +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/MANIFEST.in +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/README.rst +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/setup.cfg +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/__init__.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/_utils/BaseStringer.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/_utils/Cfg.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/_utils/Digest.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/_utils/ListStringer.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/_utils/Pattern.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/_utils/SlotStringer.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/_utils/__init__.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/_utils/cfg.toml +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/_utils/guarding.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/_utils/qualparse.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/_utils/releaseparse/__init__.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/_utils/releaseparse/listing.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/_utils/releaseparse/ranging.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/_utils/segmenting.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/core/Base.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/core/Public.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/core/Qual.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/core/Version.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/core/VersionError.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/core/__init__.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/tests/__init__.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/tests/test_testdata.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/tests/test_version.py +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440/tests/testdata.toml +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440.egg-info/SOURCES.txt +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440.egg-info/dependency_links.txt +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440.egg-info/requires.txt +0 -0
- {v440-2.0.0.dev78 → v440-2.0.0.dev80}/src/v440.egg-info/top_level.txt +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import operator
|
|
3
4
|
from typing import *
|
|
4
5
|
|
|
5
6
|
from v440.core.VersionError import VersionError
|
|
@@ -10,20 +11,13 @@ __all__ = ["numeral"]
|
|
|
10
11
|
def numeral(value: Any, /) -> int:
|
|
11
12
|
v: int
|
|
12
13
|
try:
|
|
13
|
-
|
|
14
|
+
if isinstance(value, int):
|
|
15
|
+
v = operator.index(value)
|
|
16
|
+
else:
|
|
17
|
+
v = int(str(value))
|
|
18
|
+
if v < 0:
|
|
19
|
+
raise ValueError
|
|
14
20
|
except Exception:
|
|
15
21
|
e: str = "%r is not a valid numeral segment"
|
|
16
22
|
raise VersionError(e % value) from None
|
|
17
23
|
return v
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def numeral_(value: Any, /) -> int:
|
|
21
|
-
if isinstance(value, int):
|
|
22
|
-
return int(value)
|
|
23
|
-
s: str = str(value)
|
|
24
|
-
if s == "":
|
|
25
|
-
return 0
|
|
26
|
-
i: int = int(s)
|
|
27
|
-
if i < 0:
|
|
28
|
-
raise ValueError
|
|
29
|
-
return i
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import operator
|
|
4
|
+
import string as string_
|
|
3
5
|
from typing import *
|
|
4
6
|
|
|
5
7
|
import setdoc
|
|
@@ -18,16 +20,28 @@ class Local(ListStringer):
|
|
|
18
20
|
|
|
19
21
|
@classmethod
|
|
20
22
|
def _data_parse(cls: type, value: list) -> Iterable:
|
|
21
|
-
|
|
22
|
-
if None in ans:
|
|
23
|
-
raise ValueError
|
|
24
|
-
return ans
|
|
23
|
+
return tuple(map(cls._item_parse, value))
|
|
25
24
|
|
|
26
25
|
def _format(self: Self, format_spec: str) -> str:
|
|
27
26
|
if format_spec:
|
|
28
27
|
raise ValueError
|
|
29
28
|
return ".".join(map(str, self))
|
|
30
29
|
|
|
30
|
+
@classmethod
|
|
31
|
+
def _item_parse(cls: type, value: Any) -> int | str:
|
|
32
|
+
ans: int | str
|
|
33
|
+
if isinstance(value, int):
|
|
34
|
+
ans = operator.index(value)
|
|
35
|
+
if ans < 0:
|
|
36
|
+
raise ValueError
|
|
37
|
+
else:
|
|
38
|
+
ans = str(value).lower()
|
|
39
|
+
if ans.strip(string_.digits + string_.ascii_lowercase):
|
|
40
|
+
raise ValueError
|
|
41
|
+
if not ans.strip(string_.digits):
|
|
42
|
+
ans = int(ans)
|
|
43
|
+
return ans
|
|
44
|
+
|
|
31
45
|
@classmethod
|
|
32
46
|
def _sort(cls: type, value: Any) -> tuple[bool, int | str]:
|
|
33
47
|
return type(value) is int, value
|
|
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
|
|
File without changes
|