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:
- enum interactions.ext.version.VersionAlphanumericType(value)[source]#
An enumeration.
- Member Type:
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 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]]
- 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
orrc
respectively.- Returns:
The new version with the alphanumeric.
- Return type:
- Raises:
IncorrectAlphanumeric – The alphanumeric version was incorrectly formatted.