SemanticVersion

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

Bases: neophile.inventory.version.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) neophile.inventory.version.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