Module continuous_delivery_scripts.utils.definitions

Place to store generic project concepts for the ci scripts.

Classes

class CommitType (*values)
Expand source code
class CommitType(enum.Enum):
    """Type of commits."""

    DEVELOPMENT = 1
    BETA = 2
    RELEASE = 3

    @staticmethod
    def choices() -> List[str]:
        """Gets a list of all possible commit types.

        Returns:
            a list of commit types
        """
        return [t.name.lower() for t in CommitType]

    @staticmethod
    def parse(type_str: str) -> "CommitType":
        """Determines the commit type from a string.

        Args:
            type_str: string to parse.

        Returns:
            corresponding commit type.
        """
        try:
            return CommitType[type_str.upper()]
        except KeyError as e:
            raise ValueError(f"Unknown commit type: {type_str}. {e}")

Type of commits.

Ancestors

  • enum.Enum

Class variables

var BETA

The type of the None singleton.

var DEVELOPMENT

The type of the None singleton.

var RELEASE

The type of the None singleton.

Static methods

def choices() ‑> List[str]
Expand source code
@staticmethod
def choices() -> List[str]:
    """Gets a list of all possible commit types.

    Returns:
        a list of commit types
    """
    return [t.name.lower() for t in CommitType]

Gets a list of all possible commit types.

Returns -----= a list of commit types

def parse(type_str: str) ‑> CommitType
Expand source code
@staticmethod
def parse(type_str: str) -> "CommitType":
    """Determines the commit type from a string.

    Args:
        type_str: string to parse.

    Returns:
        corresponding commit type.
    """
    try:
        return CommitType[type_str.upper()]
    except KeyError as e:
        raise ValueError(f"Unknown commit type: {type_str}. {e}")

Determines the commit type from a string.

Args
-----=
type_str
string to parse.

Returns -----= corresponding commit type.