-
-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #616 from RonnyPfannschmidt/fix-regressions
combined preparation for the 6.3.0 release and a regression resolution
- Loading branch information
Showing
20 changed files
with
400 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
[build-system] | ||
requires = ["setuptools>=45", "wheel", "tomli"] | ||
requires = [ | ||
"setuptools>=45", | ||
"wheel", | ||
"tomli>=1.0", | ||
"packaging>=20.0" | ||
] | ||
build-backend = "setuptools.build_meta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
try: | ||
from packaging.version import Version | ||
|
||
assert hasattr(Version, "release") | ||
except ImportError: | ||
from pkg_resources._vendor.packaging.version import Version as SetuptoolsVersion | ||
|
||
try: | ||
SetuptoolsVersion.release | ||
Version = SetuptoolsVersion | ||
except AttributeError: | ||
|
||
class Version(SetuptoolsVersion): # type: ignore | ||
@property | ||
def release(self): | ||
return self._version.release | ||
|
||
@property | ||
def dev(self): | ||
return self._version.dev | ||
|
||
@property | ||
def local(self): | ||
return self._version.local | ||
|
||
|
||
class NonNormalizedVersion(Version): | ||
"""A non-normalizing version handler. | ||
You can use this class to preserve version verification but skip normalization. | ||
For example you can use this to avoid git release candidate version tags | ||
("1.0.0-rc1") to be normalized to "1.0.0rc1". Only use this if you fully | ||
trust the version tags. | ||
""" | ||
|
||
def __init__(self, version): | ||
# parse and validate using parent | ||
super().__init__(version) | ||
|
||
# store raw for str | ||
self._raw_version = version | ||
|
||
def __str__(self): | ||
# return the non-normalized version (parent returns the normalized) | ||
return self._raw_version | ||
|
||
def __repr__(self): | ||
# same pattern as parent | ||
return f"<NonNormalizedVersion({self._raw_version!r})>" |
Oops, something went wrong.