diff --git a/.github/workflows/discogs_client-build.yml b/.github/workflows/discogs_client-build.yml index a900021..a4019f7 100644 --- a/.github/workflows/discogs_client-build.yml +++ b/.github/workflows/discogs_client-build.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 24605a3..feca96b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,10 +14,10 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Set up Python 3.9 + - name: Set up Python 3.12 uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: 3.12 - name: Install & Upgrade Pip run: | diff --git a/discogs_client/fetchers.py b/discogs_client/fetchers.py index 900b113..8b7e766 100644 --- a/discogs_client/fetchers.py +++ b/discogs_client/fetchers.py @@ -224,7 +224,7 @@ def fetch(self, client, method, url, data=None, headers=None, json_format=True): class FilesystemFetcher(Fetcher): """Fetches from a directory of files.""" default_response = json.dumps({'message': 'Resource not found.'}), 404 - path_with_params = re.compile('(?P(\w+/)+)(?P\w+)\?(?P.*)') + path_with_params = re.compile(r'(?P(\w+/)+)(?P\w+)\?(?P.*)') def __init__(self, base_path): self.base_path = base_path diff --git a/discogs_client/utils.py b/discogs_client/utils.py index 5959643..0371849 100644 --- a/discogs_client/utils.py +++ b/discogs_client/utils.py @@ -1,3 +1,9 @@ +try: + from enum import member +except ImportError: + def member(func): + return func + from datetime import datetime from dateutil.parser import parse from urllib.parse import quote @@ -99,6 +105,7 @@ def __get__(self, object, type): class Sort(Enum): + @member class By(Enum): ADDED = 'added' ARTIST = 'artist' @@ -120,6 +127,7 @@ class By(Enum): TITLE = 'title' YEAR = 'year' + @member class Order(Enum): ASCENDING = 'asc' DESCENDING = 'desc'