Versioning Models#

class interactions.ext.version.VersionAuthor(name, *, shared=False, active=True, email=None)[source]#

A class representing the author involved in a version.

Variables:
  • _hash (MD5Hash) – The hashed representation of the class.

  • _co_author (bool) – Whether this is a co-author or not.

  • active (bool) – Whether the author is active or not.

  • email (str) – The email of the author.

  • name (str) – The name of the author.

property is_co_author: bool#

Returns whether the author is a co-author or not.

enum interactions.ext.version.VersionAlphanumericType(value)[source]#

An enumeration.

Member Type:

str

Valid values are as follows:

ALPHA = <VersionAlphanumericType.ALPHA: 'alpha'>#
BETA = <VersionAlphanumericType.BETA: 'beta'>#
RELEASE_CANDIDATE = <VersionAlphanumericType.RELEASE_CANDIDATE: 'rc'>#
LETTER = <VersionAlphanumericType.LETTER: 'abcdefghijklmnopqrstuvwxyz'>#
class interactions.ext.version.Version(**kwargs)[source]#

A class representing how a version is structured for a 3rd party library.

Note

This class respects the design and application of Semantic Versioning 2.0.0, (SemVer) a widely accepted standardisation of version control for modules and projects.

Variables:
  • _major (int) – The major version.

  • _minor (int) – The minor version.

  • _patch (int) – The patch version.

  • _authors (List[VersionAuthor]) – The authors tied to the version release.

  • __version (str) – The representation of the version.

  • __alphanum (Optional[Dict[str, Union[int, VersionAlphanumericType]]]) – The alphanumeric typing of the version.

property major: int#

Returns the major version.

property minor: int#

Returns the minor version.

property patch: int#

Returns the patch version.

property author: Optional[Union[Exception, VersionAuthor]]#

Returns the author of the version. If multiple authors exist, it will choose the only one that is not a co-author.

Returns:

The author of the version, if one exists.

Return type:

Optional[VersionAuthor]

Raises:

TooManyAuthors – Too many main authors were found.

property authors: Optional[List[VersionAuthor]]#

Returns the list of authors under the version.

Returns:

The authors of the version, if any exist.

Return type:

Optional[List[VersionAuthor]]

property is_alphanumeric: bool#

Returns whether the version is alphanumeric or not.

classmethod extend_version(**kwargs)[source]#

Allows the version to be extended upon with an alphanumeric format.

Parameters:

**kwargs (Dict[VersionAlphanumericType, int]) – Key-word arguments to be supplied as alpha, beta or rc respectively.

Returns:

The new version with the alphanumeric.

Return type:

str

Raises:

IncorrectAlphanumeric – The alphanumeric version was incorrectly formatted.