Skip to content

Commit de3d5f6

Browse files
committed
Uncommented all invalid test cases
Add ABOUT file and NOTICE Signed-off-by: ziadhany <[email protected]>
1 parent bb7a7fd commit de3d5f6

20 files changed

+468
-80
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ For each scheme, **univers** provides an implementation for:
6262
- converting a range back to its scheme-native range syntax and to the
6363
``vers`` syntax.
6464

65-
**univers** implements ``vers``, an experimental unified and mostly universal
65+
ma**univers** implements ``vers``, an experimental unified and mostly universal
6666
version range syntax. It can parse and convert an existing native version range
6767
strings to this unified syntax. For example, this means:
6868

docs/source/conf.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,19 @@
2828
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2929
# ones.
3030
extensions = [
31-
'sphinx.ext.intersphinx',
31+
"sphinx.ext.intersphinx",
3232
]
3333

3434
# This points to aboutcode.readthedocs.io
3535
# In case of "undefined label" ERRORS check docs on intersphinx to troubleshoot
3636
# Link was created at commit - https://github.com/nexB/aboutcode/commit/faea9fcf3248f8f198844fe34d43833224ac4a83
3737

3838
intersphinx_mapping = {
39-
'aboutcode': ('https://aboutcode.readthedocs.io/en/latest/', None),
40-
'scancode-workbench': ('https://scancode-workbench.readthedocs.io/en/develop/', None),
39+
"aboutcode": ("https://aboutcode.readthedocs.io/en/latest/", None),
40+
"scancode-workbench": (
41+
"https://scancode-workbench.readthedocs.io/en/develop/",
42+
None,
43+
),
4144
}
4245

4346

@@ -62,7 +65,7 @@
6265
# so a file named "default.css" will overwrite the builtin "default.css".
6366
html_static_path = ["_static"]
6467

65-
master_doc = 'index'
68+
master_doc = "index"
6669

6770
html_context = {
6871
"css_files": [

etc/scripts/utils_thirdparty.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,10 @@ def dists_from_paths_or_urls(cls, paths_or_urls):
15031503
dists.append(dist)
15041504
if TRACE_DEEP:
15051505
print(
1506-
" ===> dists_from_paths_or_urls:", dist, "with URL:", dist.download_url
1506+
" ===> dists_from_paths_or_urls:",
1507+
dist,
1508+
"with URL:",
1509+
dist.download_url,
15071510
)
15081511
except InvalidDistributionFilename:
15091512
if TRACE_DEEP:

src/univers/conan/version.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,4 +212,7 @@ def __lt__(self, other):
212212
else:
213213
return self._nonzero_items < other._nonzero_items
214214
else: # None of them is pre-release
215-
return (self._nonzero_items, self._build) < (other._nonzero_items, other._build)
215+
return (self._nonzero_items, self._build) < (
216+
other._nonzero_items,
217+
other._build,
218+
)

src/univers/debian.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ def compare_strings(version1, version2):
256256
logger.debug("Comparing non-digit prefixes %r and %r ..", p1, p2)
257257
for c1, c2 in zip_longest(p1, p2, fillvalue=""):
258258
logger.debug(
259-
"Performing lexical comparison between characters %r and %r ..", c1, c2
259+
"Performing lexical comparison between characters %r and %r ..",
260+
c1,
261+
c2,
260262
)
261263
o1 = mapping.get(c1)
262264
o2 = mapping.get(c2)

src/univers/version_range.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,8 @@ def from_native(cls, string):
751751
comparator = ">"
752752
constraints.append(
753753
VersionConstraint(
754-
comparator=comparator, version=cls.version_class(str(lower_bound))
754+
comparator=comparator,
755+
version=cls.version_class(str(lower_bound)),
755756
)
756757
)
757758

@@ -762,7 +763,8 @@ def from_native(cls, string):
762763
comparator = "<"
763764
constraints.append(
764765
VersionConstraint(
765-
comparator=comparator, version=cls.version_class(str(upper_bound))
766+
comparator=comparator,
767+
version=cls.version_class(str(upper_bound)),
766768
)
767769
)
768770

src/univers/versions.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -488,18 +488,22 @@ def __lt__(self, other):
488488
if not isinstance(other, self.__class__):
489489
return NotImplemented
490490
# Check if versions have the same base, and `one and only one` of them is a pre-release.
491-
if (self.major, self.minor, self.build) == (other.major, other.minor, other.build) and (
492-
self.is_prerelease() != other.is_prerelease()
493-
):
491+
if (self.major, self.minor, self.build) == (
492+
other.major,
493+
other.minor,
494+
other.build,
495+
) and (self.is_prerelease() != other.is_prerelease()):
494496
return self.is_prerelease()
495497
return self.value.__lt__(other.value)
496498

497499
def __gt__(self, other):
498500
if not isinstance(other, self.__class__):
499501
return NotImplemented
500-
if (self.major, self.minor, self.build) == (other.major, other.minor, other.build) and (
501-
self.is_prerelease() != other.is_prerelease()
502-
):
502+
if (self.major, self.minor, self.build) == (
503+
other.major,
504+
other.minor,
505+
other.build,
506+
) and (self.is_prerelease() != other.is_prerelease()):
503507
return other.is_prerelease()
504508
return self.value.__gt__(other.value)
505509

tests/nuget/test_nuget_floating_range.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ def test_FloatRange_OutsideOfRange():
4646

4747
def test_FloatRange_OutsideOfRangeLower():
4848
vrange = VersionRange("[1.0.*, 2.0.0)")
49-
versions = [NuGetVersion("0.1.0"), NuGetVersion("0.2.0"), NuGetVersion("1.0.0-alpha.2")]
49+
versions = [
50+
NuGetVersion("0.1.0"),
51+
NuGetVersion("0.2.0"),
52+
NuGetVersion("1.0.0-alpha.2"),
53+
]
5054
assert not vrange.FindBestMatch(versions)
5155

5256

@@ -64,7 +68,11 @@ def test_FloatRange_OutsideOfRangeHigher():
6468

6569
def test_FloatRange_OutsideOfRangeOpen():
6670
vrange = VersionRange("[1.0.*, )")
67-
versions = [NuGetVersion("0.1.0"), NuGetVersion("0.2.0"), NuGetVersion("1.0.0-alpha.2")]
71+
versions = [
72+
NuGetVersion("0.1.0"),
73+
NuGetVersion("0.2.0"),
74+
NuGetVersion("1.0.0-alpha.2"),
75+
]
6876
assert not vrange.FindBestMatch(versions)
6977

7078

tests/nuget/test_nuget_version.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
("1.2.3", "1.2.3"),
1717
("1.2.3-alpha", "1.2.3-alpha"),
1818
("1.2.3-X.y.3+Meta-2", "1.2.3-x.y.3+Meta-2"),
19-
("1.2.3-X.yZ.3.234.243.3242342+METADATA", "1.2.3-x.yz.3.234.243.3242342+METADATA"),
19+
(
20+
"1.2.3-X.yZ.3.234.243.3242342+METADATA",
21+
"1.2.3-x.yz.3.234.243.3242342+METADATA",
22+
),
2023
("1.2.3-X.y3+0", "1.2.3-x.y3+0"),
2124
("1.2.3-X+0", "1.2.3-x+0"),
2225
("1.2.3+0", "1.2.3+0"),

tests/nuget/test_nuget_version_range.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,10 @@ def test_ParseVersionRangeSingleDigit():
204204

205205
def test_VersionRange_Exact():
206206
versionInfo = NugetVersionRange.from_native(
207-
nuget.Version.from_string(4, 3, 0), True, nuget.Version.from_string(4, 3, 0), True
207+
nuget.Version.from_string(4, 3, 0),
208+
True,
209+
nuget.Version.from_string(4, 3, 0),
210+
True,
208211
)
209212
assert versionInfo.Satisfies(nuget.Version.from_string("4.3.0"))
210213

0 commit comments

Comments
 (0)