v440 2.0.0.dev92__tar.gz → 2.0.0.dev93__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.dev92/src/v440.egg-info → v440-2.0.0.dev93}/PKG-INFO +1 -1
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/pyproject.toml +1 -1
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/guarding.py +3 -3
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/core/Local.py +5 -2
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/tests/test_testdata.py +1 -1
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/tests/test_version.py +8 -8
- {v440-2.0.0.dev92 → v440-2.0.0.dev93/src/v440.egg-info}/PKG-INFO +1 -1
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/LICENSE.txt +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/MANIFEST.in +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/README.rst +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/setup.cfg +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/__init__.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/BaseStringer.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/Cfg.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/ListStringer.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/Pattern.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/SlotStringer.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/__init__.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/cfg.toml +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/qualparse/Digest.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/qualparse/__init__.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/qualparse/devs.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/qualparse/posts.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/qualparse/pres.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/qualparse/segmenting.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/releaseparse/__init__.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/releaseparse/deleting.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/releaseparse/getting.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/releaseparse/listing.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/releaseparse/numerals.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/releaseparse/ranging.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/_utils/releaseparse/setting.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/core/Base.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/core/Public.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/core/Qual.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/core/Release.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/core/Version.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/core/VersionError.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/core/__init__.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/tests/__init__.py +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440/tests/testdata.toml +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440.egg-info/SOURCES.txt +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440.egg-info/dependency_links.txt +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440.egg-info/requires.txt +0 -0
- {v440-2.0.0.dev92 → v440-2.0.0.dev93}/src/v440.egg-info/top_level.txt +0 -0
|
@@ -9,14 +9,14 @@ from v440.core.VersionError import VersionError
|
|
|
9
9
|
def guard(old: Any) -> Any:
|
|
10
10
|
@functools.wraps(old)
|
|
11
11
|
def new(self: Self, value: Any) -> None:
|
|
12
|
-
backup: str = str(
|
|
12
|
+
backup: str = str(self)
|
|
13
13
|
try:
|
|
14
14
|
old(self, value)
|
|
15
15
|
except VersionError:
|
|
16
|
-
|
|
16
|
+
self.string = backup
|
|
17
17
|
raise
|
|
18
18
|
except Exception:
|
|
19
|
-
|
|
19
|
+
self.string = backup
|
|
20
20
|
msg: str = "%r is an invalid value for %r"
|
|
21
21
|
target: str = type(self).__name__ + "." + old.__name__
|
|
22
22
|
msg %= (value, target)
|
|
@@ -39,7 +39,10 @@ class Local(ListStringer):
|
|
|
39
39
|
|
|
40
40
|
@classmethod
|
|
41
41
|
def _data_parse(cls: type, value: list) -> Iterable:
|
|
42
|
-
|
|
42
|
+
try:
|
|
43
|
+
return tuple(map(cls._item_parse, value))
|
|
44
|
+
except Exception as exc:
|
|
45
|
+
raise ValueError("_dataparse: value=%r" % value)
|
|
43
46
|
|
|
44
47
|
def _format(self: Self, format_spec: str) -> str:
|
|
45
48
|
if format_spec:
|
|
@@ -59,7 +62,7 @@ class Local(ListStringer):
|
|
|
59
62
|
else:
|
|
60
63
|
ans = str(value).lower()
|
|
61
64
|
if ans.strip(string_.digits + string_.ascii_lowercase):
|
|
62
|
-
raise ValueError
|
|
65
|
+
raise ValueError("_item_parse: value=%r" % value)
|
|
63
66
|
if not ans.strip(string_.digits):
|
|
64
67
|
ans = int(ans)
|
|
65
68
|
return ans
|
|
@@ -17,7 +17,7 @@ class TestVersionManipulation(unittest.TestCase):
|
|
|
17
17
|
v.public.base.release.major = 2
|
|
18
18
|
v.public.base.release.minor = 5
|
|
19
19
|
v.public.qual = "beta.1"
|
|
20
|
-
v.local = "local.7.dev"
|
|
20
|
+
v.local.string = "local.7.dev"
|
|
21
21
|
|
|
22
22
|
# Verify the expected output
|
|
23
23
|
self.assertEqual(str(v), "2.5.3b1+local.7.dev")
|
|
@@ -161,7 +161,7 @@ class TestExample(unittest.TestCase):
|
|
|
161
161
|
def test_example_6(self: Self) -> None:
|
|
162
162
|
v: Version = Version("1.2.3")
|
|
163
163
|
v.public.qual.post = "post1"
|
|
164
|
-
v.local = "local.7.dev"
|
|
164
|
+
v.local.string = "local.7.dev"
|
|
165
165
|
self.assertEqual(str(v), "1.2.3.post1+local.7.dev") # Post-release version
|
|
166
166
|
self.assertEqual(format(v, "-1"), "1.2.post1+local.7.dev") # Formatted version
|
|
167
167
|
v.public.qual.post = "post.2"
|
|
@@ -173,7 +173,7 @@ class TestExample(unittest.TestCase):
|
|
|
173
173
|
self.assertEqual(str(v), "1.2.3.post3+dev.local.7") # After sorting local
|
|
174
174
|
v.local.append(8)
|
|
175
175
|
self.assertEqual(str(v), "1.2.3.post3+dev.local.7.8") # Modified with new local
|
|
176
|
-
v.local = "3.test.19"
|
|
176
|
+
v.local.string = "3.test.19"
|
|
177
177
|
self.assertEqual(str(v), "1.2.3.post3+3.test.19") # Modified local again
|
|
178
178
|
|
|
179
179
|
def test_example_7(self: Self) -> None:
|
|
@@ -314,7 +314,7 @@ class TestVersionLocal(unittest.TestCase):
|
|
|
314
314
|
def test_local_len(self: Self) -> None:
|
|
315
315
|
# Test the length of the local list
|
|
316
316
|
version: Version = Version()
|
|
317
|
-
version.local = [1, "dev", "build"]
|
|
317
|
+
version.local.data = [1, "dev", "build"]
|
|
318
318
|
self.assertEqual(len(version.local), 3)
|
|
319
319
|
|
|
320
320
|
def test_local_slice_assignment(self: Self) -> None:
|
|
@@ -350,19 +350,19 @@ class TestVersionLocal(unittest.TestCase):
|
|
|
350
350
|
def test_local_inequality_with_list(self: Self) -> None:
|
|
351
351
|
# Test inequality of local with a normal list
|
|
352
352
|
version: Version = Version()
|
|
353
|
-
version.local = [1, "dev"]
|
|
353
|
+
version.local.data = [1, "dev"]
|
|
354
354
|
self.assertFalse(version.local == [1, "build"])
|
|
355
355
|
|
|
356
356
|
def test_local_repr(self: Self) -> None:
|
|
357
357
|
# Test repr of local list
|
|
358
358
|
version: Version = Version()
|
|
359
|
-
version.local = [1, "dev", "build"]
|
|
359
|
+
version.local.data = [1, "dev", "build"]
|
|
360
360
|
self.assertEqual(str(version.local), "1.dev.build")
|
|
361
361
|
|
|
362
362
|
def test_local_data_property(self: Self) -> None:
|
|
363
363
|
# Test that 'data' property correctly reflects local's internal list
|
|
364
364
|
version: Version = Version()
|
|
365
|
-
version.local = [1, "dev", "build"]
|
|
365
|
+
version.local.data = [1, "dev", "build"]
|
|
366
366
|
self.assertEqual(version.local.data, (1, "dev", "build"))
|
|
367
367
|
|
|
368
368
|
def test_local_data_setter(self: Self) -> None:
|
|
@@ -376,7 +376,7 @@ class TestVersionLocal(unittest.TestCase):
|
|
|
376
376
|
def test_local_iterable(self: Self) -> None:
|
|
377
377
|
# Test if local supports iteration
|
|
378
378
|
version: Version = Version()
|
|
379
|
-
version.local = "1.dev.build"
|
|
379
|
+
version.local.string = "1.dev.build"
|
|
380
380
|
result: list = list(version.local)
|
|
381
381
|
self.assertEqual(result, [1, "dev", "build"])
|
|
382
382
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|