Skip to content

Commit

Permalink
fix: build failing on python 3.8
Browse files Browse the repository at this point in the history
Signed-off-by: Avior <git@avior.me>
  • Loading branch information
Aviortheking committed Aug 29, 2024
1 parent b55abf4 commit 7ec83d3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
jobs:
build_and_test:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ubuntu-latest
Expand Down
42 changes: 26 additions & 16 deletions src/tcgdexsdk/enums.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,50 @@
from enum import StrEnum
from enum import auto
from enum import Enum

# Todo when min is 3.11
# Move to StringEnum and auto

class Language(StrEnum):
EN = auto()
class Language(Enum):
EN = "en"
"""English"""
FR = auto()
FR = "fr"
"""French"""
DE = auto()
DE = "de"
"""German"""
ES = auto()
ES = "es"
"""Spanish"""
IT = auto()
IT = "it"
"""Italian"""
PT = auto()
PT = "pt"
"""Portuguese"""

def __str__(self):
return self.name.lower()

class Extension(StrEnum):

class Extension(Enum):
"""The different extension an image is available in"""

PNG = auto()
PNG = "png"
""".png image, with transparent background"""
JPG = auto()
JPG = "jpg"
""".jpg image, with white background"""
WEBP = auto()
WEBP = "webp"
""".webp image, with transparent background"""

def __str__(self):
return self.name.lower()


class Quality(StrEnum):
class Quality(Enum):
"""
Image quality if applicable
(only cards does have quality selector)
"""

HIGH = auto()
HIGH = "high"
"""the string representation of the quality"""
LOW = auto()
LOW = "low"
"""A Low quality image"""

def __str__(self):
return self.name.lower()
3 changes: 1 addition & 2 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

import vcr

from tcgdexsdk import Language
from tcgdexsdk import TCGdex
from tcgdexsdk import Language, TCGdex


def _use_cassette(test: Callable) -> Callable:
Expand Down

0 comments on commit 7ec83d3

Please sign in to comment.