PackagingVersion

class neophile.inventory.version.PackagingVersion(parsed_version: Union[LegacyVersion, Version], version: str)

Bases: neophile.inventory.version.ParsedVersion

Represents a version string using packaging.version.Version.

Methods Summary

from_str(string) Parse a string into a Version.
is_valid(string) Return whether a version is valid.

Methods Documentation

classmethod from_str(string: str) → neophile.inventory.version.PackagingVersion

Parse a string into a Version.

Parameters:string (str) – The version as a string.
Returns:version – The parsed version.
Return type:PackagingVersion
static is_valid(string: str) → bool

Return whether a version is valid.

Parameters:string (str) – The version as a string.
Returns:result – All versions are valid for this implementation (some will parse to a legacy version).
Return type:True