Skip to content

Commit

Permalink
Change: Convert ReleaseType and OutoutFormat into StrEnum's
Browse files Browse the repository at this point in the history
With this change they can be used more easily. Especially for argument
parsing.
  • Loading branch information
bjoernricks committed Feb 5, 2024
1 parent 9498433 commit e2b67e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pontos/release/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# SPDX-License-Identifier: GPL-3.0-or-later
#

from enum import Enum
from typing import Optional

from pontos.enum import StrEnum
from pontos.git import Git, GitError
from pontos.terminal import Terminal
from pontos.version import Version, VersionCalculator, VersionError
Expand All @@ -14,7 +14,7 @@
DEFAULT_CHUNK_SIZE = 4096


class ReleaseType(Enum):
class ReleaseType(StrEnum):
"""
Type of the release. Used to determine the next release version.
Expand Down
5 changes: 3 additions & 2 deletions pontos/release/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

import json
from argparse import Namespace
from enum import Enum, IntEnum, auto
from enum import IntEnum, auto
from typing import Optional

from pontos.enum import StrEnum
from pontos.errors import PontosError
from pontos.git import Git
from pontos.github.actions import ActionIO
Expand All @@ -29,7 +30,7 @@ class ShowReleaseReturnValue(IntEnum):
NO_RELEASE_VERSION = auto()


class OutputFormat(Enum):
class OutputFormat(StrEnum):
ENV = "env"
JSON = "json"
GITHUB_ACTION = "github-action"
Expand Down

0 comments on commit e2b67e6

Please sign in to comment.