Skip to content

Commit

Permalink
Merge pull request #141 from arogl/arogl-patch-1
Browse files Browse the repository at this point in the history
Small fixes for Python 3.12 references #140
  • Loading branch information
JOJ0 authored Oct 12, 2024
2 parents 6153797 + 8be5348 commit b4d0cdc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/discogs_client-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion discogs_client/fetchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<dir>(\w+/)+)(?P<query>\w+)\?(?P<params>.*)')
path_with_params = re.compile(r'(?P<dir>(\w+/)+)(?P<query>\w+)\?(?P<params>.*)')

def __init__(self, base_path):
self.base_path = base_path
Expand Down
8 changes: 8 additions & 0 deletions discogs_client/utils.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -99,6 +105,7 @@ def __get__(self, object, type):


class Sort(Enum):
@member
class By(Enum):
ADDED = 'added'
ARTIST = 'artist'
Expand All @@ -120,6 +127,7 @@ class By(Enum):
TITLE = 'title'
YEAR = 'year'

@member
class Order(Enum):
ASCENDING = 'asc'
DESCENDING = 'desc'
Expand Down

0 comments on commit b4d0cdc

Please sign in to comment.