v440 2.0.0.dev37__tar.gz → 2.0.0.dev39__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.
Files changed (34) hide show
  1. {v440-2.0.0.dev37/src/v440.egg-info → v440-2.0.0.dev39}/PKG-INFO +1 -1
  2. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/pyproject.toml +1 -1
  3. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/_utils/SlotList.py +0 -1
  4. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/_utils/qualparse.py +7 -9
  5. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/core/Local.py +5 -5
  6. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/tests/test_testdata.py +32 -9
  7. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/tests/testdata.toml +15 -0
  8. {v440-2.0.0.dev37 → v440-2.0.0.dev39/src/v440.egg-info}/PKG-INFO +1 -1
  9. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/LICENSE.txt +0 -0
  10. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/MANIFEST.in +0 -0
  11. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/README.rst +0 -0
  12. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/setup.cfg +0 -0
  13. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/__init__.py +0 -0
  14. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/_utils/BaseList.py +0 -0
  15. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/_utils/Cfg.py +0 -0
  16. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/_utils/Digest.py +0 -0
  17. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/_utils/Pattern.py +0 -0
  18. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/_utils/VList.py +0 -0
  19. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/_utils/__init__.py +0 -0
  20. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/_utils/cfg.toml +0 -0
  21. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/_utils/utils.py +0 -0
  22. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/core/Base.py +0 -0
  23. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/core/Public.py +0 -0
  24. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/core/Qual.py +0 -0
  25. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/core/Release.py +0 -0
  26. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/core/Version.py +0 -0
  27. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/core/VersionError.py +0 -0
  28. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/core/__init__.py +0 -0
  29. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/tests/__init__.py +0 -0
  30. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440/tests/test_version.py +0 -0
  31. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440.egg-info/SOURCES.txt +0 -0
  32. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440.egg-info/dependency_links.txt +0 -0
  33. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440.egg-info/requires.txt +0 -0
  34. {v440-2.0.0.dev37 → v440-2.0.0.dev39}/src/v440.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: v440
3
- Version: 2.0.0.dev37
3
+ Version: 2.0.0.dev39
4
4
  Summary: This project provides mutable version objects in accordance with PEP440.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License: The MIT License (MIT)
@@ -34,7 +34,7 @@ keywords = []
34
34
  name = "v440"
35
35
  readme = "README.rst"
36
36
  requires-python = ">=3.11"
37
- version = "2.0.0.dev37"
37
+ version = "2.0.0.dev39"
38
38
 
39
39
  [project.license]
40
40
  file = "LICENSE.txt"
@@ -8,7 +8,6 @@ from datarepr import datarepr
8
8
  from unhash import unhash
9
9
 
10
10
  from v440._utils.BaseList import BaseList
11
- from v440._utils.utils import guard
12
11
  from v440.core.VersionError import VersionError
13
12
 
14
13
  __all__ = ["SlotList"]
@@ -108,14 +108,14 @@ def parse_dev(value: int) -> int:
108
108
 
109
109
  @parse_dev.overload(list)
110
110
  def parse_dev(value: list) -> Optional[int]:
111
- v: list = list(map(utils.segment, value))
112
- if len(v) != 2:
111
+ x: Any
112
+ y: Any
113
+ x, y = map(utils.segment, value)
114
+ if x != "dev":
113
115
  raise ValueError
114
- if v[0] != "dev":
116
+ if isinstance(y, str):
115
117
  raise ValueError
116
- if isinstance(v[1], str):
117
- raise ValueError
118
- return v[1]
118
+ return y
119
119
 
120
120
 
121
121
  @parse_dev.overload(str)
@@ -175,7 +175,5 @@ def parse_post(value: str) -> Optional[int]:
175
175
  x, y = m.groups()
176
176
  if x not in (None, "post", "rev", "r"):
177
177
  raise ValueError
178
- if y is None:
179
- return None
180
- else:
178
+ if y is not None:
181
179
  return int(y)
@@ -28,20 +28,20 @@ class Local(VList):
28
28
  except ValueError:
29
29
  ans = self.data <= other
30
30
  else:
31
- ans = self._cmpkey() <= alt._cmpkey()
31
+ ans = self._cmp() <= alt._cmp()
32
32
  return ans
33
33
 
34
34
  def __str__(self: Self) -> str:
35
35
  "This magic method implements str(self)."
36
36
  return ".".join(map(str, self))
37
37
 
38
- def _cmpkey(self: Self) -> list:
38
+ def _cmp(self: Self) -> list:
39
39
  return list(map(self._sortkey, self))
40
40
 
41
41
  _data_calc: Digest = Digest("_data_calc")
42
42
 
43
43
  @_data_calc.overload()
44
- def _data_calc(self: Self) -> None:
44
+ def _data_calc(self: Self) -> list:
45
45
  return list()
46
46
 
47
47
  @_data_calc.overload(int)
@@ -56,7 +56,7 @@ class Local(VList):
56
56
  return ans
57
57
 
58
58
  @_data_calc.overload(str)
59
- def _data_calc(self: Self, value: str) -> None:
59
+ def _data_calc(self: Self, value: str) -> list:
60
60
  v: str = value
61
61
  if v.startswith("+"):
62
62
  v = v[1:]
@@ -69,7 +69,7 @@ class Local(VList):
69
69
  return ans
70
70
 
71
71
  @staticmethod
72
- def _sortkey(value: Any) -> Tuple[bool, Any]:
72
+ def _sortkey(value: Any) -> tuple[bool, Any]:
73
73
  return type(value) is int, value
74
74
 
75
75
  @property
@@ -9,6 +9,7 @@ from typing import *
9
9
  import iterprod
10
10
  import packaging.version
11
11
 
12
+ from v440 import core
12
13
  from v440.core.Release import Release
13
14
  from v440.core.Version import Version
14
15
  from v440.core.VersionError import VersionError
@@ -353,17 +354,39 @@ class TestPackagingExc(unittest.TestCase):
353
354
 
354
355
  class TestExc(unittest.TestCase):
355
356
  def test_exc(self: Self) -> None:
356
- k: str
357
- l: list
358
- for k, l in Util.util.data["strings"]["exc"].items():
359
- self.go(key=k, queries=l)
357
+ x: str
358
+ y: list
359
+ for x, y in Util.util.data["strings"]["exc"].items():
360
+ with self.subTest(test_label=x):
361
+ self.go(queries=y)
360
362
 
361
- def go(self: Self, key: str, queries: list) -> None:
363
+ def go(self: Self, queries: list) -> None:
362
364
  x: str
363
- with self.subTest(key=key):
364
- for x in queries:
365
- with self.assertRaises(VersionError):
366
- Version(x)
365
+ for x in queries:
366
+ with self.assertRaises(VersionError):
367
+ Version(x)
368
+
369
+
370
+ class TestSlots(unittest.TestCase):
371
+ def test_slots(self: Self) -> None:
372
+ x: Any
373
+ y: Any
374
+ for x, y in Util.util.data["core-non-attributes"].items():
375
+ with self.subTest(test_label=x):
376
+ self.go(**y)
377
+
378
+ def go(
379
+ self: Self,
380
+ clsname: str,
381
+ attrname: str,
382
+ attrvalue: Any,
383
+ data: Any = None,
384
+ ) -> None:
385
+ module: Any = getattr(core, clsname)
386
+ cls: type = getattr(module, clsname)
387
+ obj: Any = cls(data)
388
+ with self.assertRaises(AttributeError):
389
+ setattr(obj, attrname, attrvalue)
367
390
 
368
391
 
369
392
  if __name__ == "__main__":
@@ -1024,3 +1024,18 @@ part = 1
1024
1024
  [epoch.test_epoch_as_none]
1025
1025
  full = "1.2.3"
1026
1026
  part = 0
1027
+
1028
+ [core-non-attributes.test-0000]
1029
+ clsname = "Base"
1030
+ attrname = "fdsfvdsff"
1031
+ attrvalue = 42
1032
+
1033
+ [core-non-attributes.test-0100]
1034
+ clsname = "Public"
1035
+ attrname = "fdsfvdsff"
1036
+ attrvalue = 42
1037
+
1038
+ [core-non-attributes.test-0200]
1039
+ clsname = "Qual"
1040
+ attrname = "fdsfvdsff"
1041
+ attrvalue = 42
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: v440
3
- Version: 2.0.0.dev37
3
+ Version: 2.0.0.dev39
4
4
  Summary: This project provides mutable version objects in accordance with PEP440.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License: The MIT License (MIT)
File without changes
File without changes
File without changes
File without changes