metadata: normalize version via CargoSemVer
This commit is contained in:
parent
fcbf95a78e
commit
23e807d8ce
1 changed files with 4 additions and 4 deletions
|
@ -220,10 +220,10 @@ class Metadata:
|
||||||
def __init__(self, name, version):
|
def __init__(self, name, version):
|
||||||
self.name = name
|
self.name = name
|
||||||
self._version = version
|
self._version = version
|
||||||
version_normalized = Dependency._normalize_req(f"={self._version}")
|
version_normalized = CargoSemVer.unparse_version(
|
||||||
if len(version_normalized) != 1:
|
CargoSemVer.coerce(
|
||||||
raise Exception(f"Incorrect version: {self._version}")
|
CargoSemVer.parse_version(self._version)))
|
||||||
self.version = version_normalized[0][1]
|
self.version = version_normalized
|
||||||
self.license = None
|
self.license = None
|
||||||
self.license_file = None
|
self.license_file = None
|
||||||
self.readme = None
|
self.readme = None
|
||||||
|
|
Loading…
Reference in a new issue