SemanticVersion

class neophile.inventory.version.SemanticVersion(parsed_version: Version, version: str)

Bases: ParsedVersion

Represents a semantic version string.

Methods Summary

from_str(string)

Parse a string into a semver.VersionInfo.

is_valid(string)

Return whether a version is valid.

Methods Documentation

classmethod from_str(string: str) → SemanticVersion

Parse a string into a semver.VersionInfo.

Parameters:

string (str) – The version as a string.

Returns:

version – The parsed version.

Return type:

SemanticVersion

static is_valid(string: str) → bool

Return whether a version is valid.

Parameters:

string (str) – The version as a string.

Returns:

result – Whether the version is valid.

Return type:

bool