v440 2.0.0.dev109__tar.gz → 2.0.0.dev111__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.dev109/src/v440.egg-info → v440-2.0.0.dev111}/PKG-INFO +1 -1
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/pyproject.toml +1 -1
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/core/Qual.py +18 -11
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/tests/test_testdata.py +8 -7
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/tests/test_version.py +3 -3
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/tests/testdata.toml +21 -27
- {v440-2.0.0.dev109 → v440-2.0.0.dev111/src/v440.egg-info}/PKG-INFO +1 -1
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/LICENSE.txt +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/MANIFEST.in +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/README.rst +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/setup.cfg +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/__init__.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/BaseStringer.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/Cfg.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/ListStringer.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/Pattern.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/SlotStringer.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/__init__.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/cfg.toml +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/guarding.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/qualparse/Digest.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/qualparse/__init__.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/qualparse/devs.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/qualparse/posts.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/qualparse/pres.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/qualparse/segmenting.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/releaseparse/__init__.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/releaseparse/deleting.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/releaseparse/getting.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/releaseparse/listing.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/releaseparse/numerals.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/releaseparse/ranging.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/_utils/releaseparse/setting.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/core/Base.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/core/Local.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/core/Public.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/core/Release.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/core/Version.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/core/VersionError.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/core/__init__.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440/tests/__init__.py +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440.egg-info/SOURCES.txt +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440.egg-info/dependency_links.txt +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/src/v440.egg-info/requires.txt +0 -0
- {v440-2.0.0.dev109 → v440-2.0.0.dev111}/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
|
import setdoc
|
|
@@ -95,27 +96,25 @@ class Qual(SlotStringer):
|
|
|
95
96
|
m: Any
|
|
96
97
|
x: Any
|
|
97
98
|
y: Any
|
|
99
|
+
self.dev = None
|
|
100
|
+
self.post = None
|
|
98
101
|
pre: Any = (None, None)
|
|
99
|
-
post: Any = None
|
|
100
|
-
dev: Any = None
|
|
101
102
|
while v:
|
|
102
103
|
m = Pattern.QUALIFIERS.leftbound.search(v)
|
|
103
104
|
v = v[m.end() :]
|
|
104
105
|
if m.group("N"):
|
|
105
|
-
post = m.group("N")
|
|
106
|
+
self.post = int(m.group("N"))
|
|
106
107
|
continue
|
|
107
108
|
x = m.group("l")
|
|
108
109
|
y = m.group("n")
|
|
109
110
|
if x == "dev":
|
|
110
|
-
dev = y
|
|
111
|
+
self.dev = int(y)
|
|
111
112
|
continue
|
|
112
113
|
if x in ("post", "r", "rev"):
|
|
113
|
-
post = y
|
|
114
|
+
self.post = int(y)
|
|
114
115
|
continue
|
|
115
116
|
pre = x, y
|
|
116
117
|
self.pre = pre
|
|
117
|
-
self.post = post
|
|
118
|
-
self.dev = dev
|
|
119
118
|
|
|
120
119
|
def _todict(self: Self) -> dict:
|
|
121
120
|
return dict(pre=self.pre, post=self.post, dev=self.dev)
|
|
@@ -127,8 +126,13 @@ class Qual(SlotStringer):
|
|
|
127
126
|
|
|
128
127
|
@dev.setter
|
|
129
128
|
@guard
|
|
130
|
-
def dev(self: Self, value:
|
|
131
|
-
|
|
129
|
+
def dev(self: Self, value: Optional[SupportsIndex]) -> None:
|
|
130
|
+
if value is None:
|
|
131
|
+
self._dev = None
|
|
132
|
+
return
|
|
133
|
+
self._dev: int = operator.index(value)
|
|
134
|
+
if self._dev < 0:
|
|
135
|
+
raise ValueError
|
|
132
136
|
|
|
133
137
|
def isdevrelease(self: Self) -> bool:
|
|
134
138
|
"This method returns whether the current instance denotes a dev-release."
|
|
@@ -148,8 +152,11 @@ class Qual(SlotStringer):
|
|
|
148
152
|
|
|
149
153
|
@post.setter
|
|
150
154
|
@guard
|
|
151
|
-
def post(self: Self, value:
|
|
152
|
-
|
|
155
|
+
def post(self: Self, value: Optional[SupportsIndex]) -> None:
|
|
156
|
+
if value is None:
|
|
157
|
+
self._post = None
|
|
158
|
+
return
|
|
159
|
+
self._post: int = abs(operator.index(value))
|
|
153
160
|
|
|
154
161
|
@property
|
|
155
162
|
def pre(self: Self) -> tuple:
|
|
@@ -202,11 +202,12 @@ class TestVersionRelease(unittest.TestCase):
|
|
|
202
202
|
class TestDevGo(unittest.TestCase):
|
|
203
203
|
def test_dev_as_tuple(self: Self) -> None:
|
|
204
204
|
self.go_key(
|
|
205
|
-
key="
|
|
206
|
-
setup="1.2.3",
|
|
207
|
-
update=
|
|
208
|
-
text="1.2.3
|
|
209
|
-
|
|
205
|
+
key="test_dev_as_list_mixed_case",
|
|
206
|
+
setup="1.2.3.dev9000",
|
|
207
|
+
update=None,
|
|
208
|
+
text="1.2.3",
|
|
209
|
+
solution=None,
|
|
210
|
+
dev_type=type(None),
|
|
210
211
|
)
|
|
211
212
|
|
|
212
213
|
def test_strings_a(self: Self) -> None:
|
|
@@ -225,7 +226,7 @@ class TestDevGo(unittest.TestCase):
|
|
|
225
226
|
msg: str,
|
|
226
227
|
setup: Any,
|
|
227
228
|
text: str,
|
|
228
|
-
|
|
229
|
+
solution: Any = None,
|
|
229
230
|
update: Any = None,
|
|
230
231
|
dev_type: type = int,
|
|
231
232
|
):
|
|
@@ -233,7 +234,7 @@ class TestDevGo(unittest.TestCase):
|
|
|
233
234
|
v.public.qual.dev = update
|
|
234
235
|
self.assertEqual(str(v), text, msg=msg)
|
|
235
236
|
self.assertIsInstance(v.public.qual.dev, dev_type, msg=msg)
|
|
236
|
-
self.assertEqual(v.public.qual.dev,
|
|
237
|
+
self.assertEqual(v.public.qual.dev, solution, msg=msg)
|
|
237
238
|
|
|
238
239
|
|
|
239
240
|
class TestVersionSpecifiersGo(unittest.TestCase):
|
|
@@ -159,15 +159,15 @@ class TestExample(unittest.TestCase):
|
|
|
159
159
|
|
|
160
160
|
def test_example_6(self: Self) -> None:
|
|
161
161
|
v: Version = Version("1.2.3")
|
|
162
|
-
v.public.qual.post =
|
|
162
|
+
v.public.qual.post = 1
|
|
163
163
|
v.local.string = "local.7.dev"
|
|
164
164
|
self.assertEqual(str(v), "1.2.3.post1+local.7.dev") # Post-release version
|
|
165
165
|
self.assertEqual(format(v, "-1"), "1.2.post1+local.7.dev") # Formatted version
|
|
166
|
-
v.public.qual.post =
|
|
166
|
+
v.public.qual.post = 2
|
|
167
167
|
self.assertEqual(str(v), "1.2.3.post2+local.7.dev") # Modified version
|
|
168
168
|
v.public.qual.post = None
|
|
169
169
|
self.assertEqual(str(v), "1.2.3+local.7.dev") # Modified without post
|
|
170
|
-
v.public.qual.post =
|
|
170
|
+
v.public.qual.post = 3
|
|
171
171
|
v.local.sort()
|
|
172
172
|
self.assertEqual(str(v), "1.2.3.post3+dev.local.7") # After sorting local
|
|
173
173
|
v.local.append(8)
|
|
@@ -752,79 +752,73 @@ Post-releases = [
|
|
|
752
752
|
setup = "1.2.3"
|
|
753
753
|
update = 1
|
|
754
754
|
text = "1.2.3.dev1"
|
|
755
|
-
|
|
755
|
+
solution = 1
|
|
756
756
|
|
|
757
757
|
[devint.test_dev_as_string_int]
|
|
758
758
|
setup = "1.2.3"
|
|
759
|
-
update =
|
|
759
|
+
update = 42
|
|
760
760
|
text = "1.2.3.dev42"
|
|
761
|
-
|
|
761
|
+
solution = 42
|
|
762
762
|
|
|
763
763
|
[devint.test_dev_as_string_with_dev_prefix]
|
|
764
764
|
setup = "1.2.3"
|
|
765
|
-
update =
|
|
765
|
+
update = 1000
|
|
766
766
|
text = "1.2.3.dev1000"
|
|
767
|
-
|
|
767
|
+
solution = 1000
|
|
768
768
|
|
|
769
769
|
[devint.test_dev_as_string_with_dev_dot_prefix]
|
|
770
770
|
setup = "1.2.3"
|
|
771
|
-
update =
|
|
771
|
+
update = 2000
|
|
772
772
|
text = "1.2.3.dev2000"
|
|
773
|
-
|
|
773
|
+
solution = 2000
|
|
774
774
|
|
|
775
775
|
[devint.test_dev_as_string_with_dot_dev_prefix]
|
|
776
776
|
setup = "1.2.3"
|
|
777
|
-
update =
|
|
777
|
+
update = 3000
|
|
778
778
|
text = "1.2.3.dev3000"
|
|
779
|
-
|
|
779
|
+
solution = 3000
|
|
780
780
|
|
|
781
781
|
[devint.test_dev_as_string_with_dot_dev_number_prefix]
|
|
782
782
|
setup = "1.2.3"
|
|
783
|
-
update =
|
|
783
|
+
update = 4000
|
|
784
784
|
text = "1.2.3.dev4000"
|
|
785
|
-
|
|
785
|
+
solution = 4000
|
|
786
786
|
|
|
787
787
|
[devint.test_dev_as_list]
|
|
788
788
|
setup = "1.2.3"
|
|
789
|
-
update =
|
|
790
|
-
"dev",
|
|
791
|
-
"6000",
|
|
792
|
-
]
|
|
789
|
+
update = 6000
|
|
793
790
|
text = "1.2.3.dev6000"
|
|
794
|
-
|
|
791
|
+
solution = 6000
|
|
795
792
|
|
|
796
793
|
[devint.test_dev_as_uppercase_string]
|
|
797
794
|
setup = "1.2.3"
|
|
798
|
-
update =
|
|
795
|
+
update = 7000
|
|
799
796
|
text = "1.2.3.dev7000"
|
|
800
|
-
|
|
797
|
+
solution = 7000
|
|
801
798
|
|
|
802
799
|
[devint.test_dev_as_mixed_case_string]
|
|
803
800
|
setup = "1.2.3"
|
|
804
|
-
update =
|
|
801
|
+
update = 8000
|
|
805
802
|
text = "1.2.3.dev8000"
|
|
806
|
-
|
|
803
|
+
solution = 8000
|
|
807
804
|
|
|
808
805
|
[devint.test_dev_as_list_mixed_case]
|
|
809
806
|
setup = "1.2.3"
|
|
810
|
-
update =
|
|
811
|
-
"dEV",
|
|
812
|
-
"9000",
|
|
813
|
-
]
|
|
807
|
+
update = 9000
|
|
814
808
|
text = "1.2.3.dev9000"
|
|
815
|
-
|
|
809
|
+
solution = 9000
|
|
816
810
|
|
|
817
811
|
[devint.test_dev_as_false]
|
|
818
812
|
setup = "1.2.3"
|
|
819
813
|
update = false
|
|
820
814
|
text = "1.2.3.dev0"
|
|
821
|
-
|
|
815
|
+
solution = 0
|
|
822
816
|
|
|
823
817
|
[devint.test_dev_as_true]
|
|
824
818
|
setup = "1.2.3"
|
|
825
819
|
update = true
|
|
826
820
|
text = "1.2.3.dev1"
|
|
827
|
-
|
|
821
|
+
solution = 1
|
|
828
822
|
|
|
829
823
|
[spec.test_basic_version_with_post_specifier]
|
|
830
824
|
string_a = "1.2.3-4"
|
|
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
|