diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py index 6dd8bb0..99debf3 100644 --- a/rust2rpm/metadata.py +++ b/rust2rpm/metadata.py @@ -220,10 +220,10 @@ class Metadata: def __init__(self, name, version): self.name = name self._version = version - version_normalized = Dependency._normalize_req(f"={self._version}") - if len(version_normalized) != 1: - raise Exception(f"Incorrect version: {self._version}") - self.version = version_normalized[0][1] + version_normalized = CargoSemVer.unparse_version( + CargoSemVer.coerce( + CargoSemVer.parse_version(self._version))) + self.version = version_normalized self.license = None self.license_file = None self.readme = None