v440 2.0.0.dev68__tar.gz → 2.0.0.dev70__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.dev68/src/v440.egg-info → v440-2.0.0.dev70}/PKG-INFO +1 -1
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/pyproject.toml +1 -1
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/_utils/ListStringer.py +1 -3
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/tests/test_testdata.py +75 -51
- {v440-2.0.0.dev68 → v440-2.0.0.dev70/src/v440.egg-info}/PKG-INFO +1 -1
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/LICENSE.txt +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/MANIFEST.in +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/README.rst +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/setup.cfg +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/__init__.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/_utils/BaseStringer.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/_utils/Cfg.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/_utils/Digest.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/_utils/Pattern.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/_utils/SlotStringer.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/_utils/__init__.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/_utils/cfg.toml +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/_utils/guarding.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/_utils/qualparse.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/_utils/releaseparse.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/_utils/segmenting.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/core/Base.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/core/Local.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/core/Public.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/core/Qual.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/core/Release.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/core/Version.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/core/VersionError.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/core/__init__.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/tests/__init__.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/tests/test_version.py +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440/tests/testdata.toml +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440.egg-info/SOURCES.txt +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440.egg-info/dependency_links.txt +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440.egg-info/requires.txt +0 -0
- {v440-2.0.0.dev68 → v440-2.0.0.dev70}/src/v440.egg-info/top_level.txt +0 -0
|
@@ -178,9 +178,7 @@ class ListStringer(BaseStringer, collections.abc.MutableSequence):
|
|
|
178
178
|
self._data = ()
|
|
179
179
|
|
|
180
180
|
def _set(self: Self, value: Any) -> None:
|
|
181
|
-
if value
|
|
182
|
-
self.data = ()
|
|
183
|
-
elif isinstance(value, str):
|
|
181
|
+
if isinstance(value, str):
|
|
184
182
|
self.string = value
|
|
185
183
|
elif hasattr(value, "__iter__"):
|
|
186
184
|
self.data = value
|
|
@@ -255,14 +255,10 @@ class TestPackagingA(unittest.TestCase):
|
|
|
255
255
|
self.go(text=s)
|
|
256
256
|
|
|
257
257
|
def go(self: Self, text: str) -> None:
|
|
258
|
-
a: packaging.version.Version
|
|
259
|
-
b: str
|
|
260
|
-
f: int
|
|
261
|
-
g: str
|
|
262
|
-
a = packaging.version.Version(text)
|
|
263
|
-
b = str(a)
|
|
264
|
-
f = len(a.release)
|
|
265
|
-
g = format(Version(text), str(f))
|
|
258
|
+
a: packaging.version.Version = packaging.version.Version(text)
|
|
259
|
+
b: str = str(a)
|
|
260
|
+
f: int = len(a.release)
|
|
261
|
+
g: str = format(Version(text), str(f))
|
|
266
262
|
self.assertEqual(b, g)
|
|
267
263
|
|
|
268
264
|
|
|
@@ -289,9 +285,9 @@ class TestPackagingB(unittest.TestCase):
|
|
|
289
285
|
class TestPackagingC(unittest.TestCase):
|
|
290
286
|
def test_strings_c(self: Self) -> None:
|
|
291
287
|
pure: list = list()
|
|
292
|
-
|
|
293
|
-
for
|
|
294
|
-
pure +=
|
|
288
|
+
part: list
|
|
289
|
+
for part in Util.util.data["strings"]["valid"].values():
|
|
290
|
+
pure += part
|
|
295
291
|
ops: list = [
|
|
296
292
|
operator.eq,
|
|
297
293
|
operator.ne,
|
|
@@ -300,57 +296,85 @@ class TestPackagingC(unittest.TestCase):
|
|
|
300
296
|
operator.le,
|
|
301
297
|
operator.lt,
|
|
302
298
|
]
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
convert = op(b, d)
|
|
318
|
-
msg = f"{op} should match for {x!r} and {y!r}"
|
|
319
|
-
self.assertEqual(native, convert, msg=msg)
|
|
299
|
+
args: tuple
|
|
300
|
+
for args in iterprod.iterprod(pure, pure, ops):
|
|
301
|
+
with self.subTest(args=args):
|
|
302
|
+
self.go(*args)
|
|
303
|
+
|
|
304
|
+
def go(self: Self, x: str, y: str, func: Callable, /) -> None:
|
|
305
|
+
a: packaging.version.Version = packaging.version.Version(x)
|
|
306
|
+
b: packaging.version.Version = Version(string=x).packaging()
|
|
307
|
+
c: packaging.version.Version = packaging.version.Version(y)
|
|
308
|
+
d: packaging.version.Version = Version(string=y).packaging()
|
|
309
|
+
native: bool = func(a, c)
|
|
310
|
+
convert: bool = func(b, d)
|
|
311
|
+
msg: str = f"{func} should match for {x!r} and {y!r}"
|
|
312
|
+
self.assertEqual(native, convert, msg=msg)
|
|
320
313
|
|
|
321
314
|
|
|
322
315
|
class TestPackagingField(unittest.TestCase):
|
|
323
316
|
def test_field(self: Self) -> None:
|
|
324
|
-
|
|
317
|
+
k: str
|
|
325
318
|
l: list
|
|
326
|
-
for l in Util.util.data["strings"]["valid"].
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
319
|
+
for k, l in Util.util.data["strings"]["valid"].items():
|
|
320
|
+
with self.subTest(key=k):
|
|
321
|
+
self.go_list(l)
|
|
322
|
+
for k, l in Util.util.data["strings"]["incomp"].items():
|
|
323
|
+
with self.subTest(key=k):
|
|
324
|
+
self.go_list(l)
|
|
325
|
+
|
|
326
|
+
def go_list(self: Self, listing: list) -> None:
|
|
332
327
|
x: str
|
|
333
|
-
for x in
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
328
|
+
for x in listing:
|
|
329
|
+
with self.subTest():
|
|
330
|
+
self.go(query=x)
|
|
331
|
+
|
|
332
|
+
def go(self: Self, query: str) -> None:
|
|
333
|
+
v: Version = Version(query)
|
|
334
|
+
self.assertEqual(
|
|
335
|
+
v.public.qual.isdevrelease(),
|
|
336
|
+
v.packaging().is_devrelease,
|
|
337
|
+
)
|
|
338
|
+
self.assertEqual(
|
|
339
|
+
v.public.qual.isprerelease(),
|
|
340
|
+
v.packaging().is_prerelease,
|
|
341
|
+
)
|
|
342
|
+
self.assertEqual(
|
|
343
|
+
v.public.qual.ispostrelease(),
|
|
344
|
+
v.packaging().is_postrelease,
|
|
345
|
+
)
|
|
346
|
+
self.assertEqual(
|
|
347
|
+
str(v.public.base),
|
|
348
|
+
v.packaging().base_version,
|
|
349
|
+
)
|
|
350
|
+
self.assertEqual(
|
|
351
|
+
str(v.public),
|
|
352
|
+
v.packaging().public,
|
|
353
|
+
)
|
|
354
|
+
local_packaging: Optional[str] = v.packaging().local
|
|
355
|
+
if local_packaging is None:
|
|
356
|
+
local_packaging = ""
|
|
357
|
+
self.assertEqual(
|
|
358
|
+
str(v.local),
|
|
359
|
+
str(local_packaging),
|
|
360
|
+
)
|
|
344
361
|
|
|
345
362
|
|
|
346
363
|
class TestPackagingExc(unittest.TestCase):
|
|
347
364
|
def test_exc_pack(self: Self) -> None:
|
|
348
|
-
|
|
365
|
+
k: str
|
|
366
|
+
for k in ("incomp", "exc"):
|
|
367
|
+
with self.subTest(strings=k):
|
|
368
|
+
self.go_dict(Util.util.data["strings"][k])
|
|
369
|
+
|
|
370
|
+
def go_dict(self: Self, dictionary: dict, /) -> None:
|
|
371
|
+
k: str
|
|
349
372
|
l: list
|
|
350
|
-
for l in
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
373
|
+
for k, l in dictionary.items():
|
|
374
|
+
with self.subTest(key=k):
|
|
375
|
+
self.go_list(l)
|
|
376
|
+
|
|
377
|
+
def go_list(self: Self, impure: list, /) -> None:
|
|
354
378
|
x: str
|
|
355
379
|
for x in impure:
|
|
356
380
|
with self.assertRaises(packaging.version.InvalidVersion):
|
|
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
|