Skip to content

Commit

Permalink
Поддержка Python 3.12 (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX committed Dec 24, 2023
1 parent cc8331f commit 8aafa15
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11" ]
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11", "3.12" ]

steps:
- name: Checkout repository.
Expand Down
7 changes: 5 additions & 2 deletions setup.py
Expand Up @@ -12,10 +12,10 @@ def run_tests(self) -> None:
sys.exit(pytest.main(['tests']))


with open('yandex_music/__init__.py', encoding='utf-8') as f:
with open('yandex_music/__init__.py', encoding='UTF-8') as f:
version = re.findall(r"__version__ = '(.+)'", f.read())[0]

with open('README.md', 'r', encoding='utf-8') as f:
with open('README.md', 'r', encoding='UTF-8') as f:
readme = f.read()

setup(
Expand Down Expand Up @@ -50,6 +50,7 @@ def run_tests(self) -> None:
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
Expand All @@ -59,6 +60,8 @@ def run_tests(self) -> None:
tests_require=['pytest'],
project_urls={
'Documentation': 'https://yandex-music.rtfd.io',
'Changes': 'https://github.com/MarshalX/yandex-music-api/blob/main/CHANGES.md',
'Tracker': 'https://github.com/MarshalX/yandex-music-api/issues',
'Telegram chat': 'https://t.me/yandex_music_api',
'Codecov': 'https://codecov.io/gh/MarshalX/yandex-music-api',
'Codacy': 'https://app.codacy.com/gh/MarshalX/yandex-music-api',
Expand Down
2 changes: 1 addition & 1 deletion yandex_music/download_info.py
Expand Up @@ -56,7 +56,7 @@ def __build_direct_link(self, xml: str) -> str:
path = self._get_text_node_data(doc.getElementsByTagName('path'))
ts = self._get_text_node_data(doc.getElementsByTagName('ts'))
s = self._get_text_node_data(doc.getElementsByTagName('s'))
sign = md5((SIGN_SALT + path[1::] + s).encode('utf-8')).hexdigest() # noqa: S324
sign = md5((SIGN_SALT + path[1::] + s).encode('UTF-8')).hexdigest() # noqa: S324

return f'https://{host}/get-mp3/{sign}/{ts}{path}'

Expand Down
2 changes: 1 addition & 1 deletion yandex_music/utils/request.py
Expand Up @@ -167,7 +167,7 @@ def _parse(self, json_data: bytes) -> Optional[Response]:
:class:`yandex_music.exceptions.YandexMusicError`: Базовое исключение библиотеки.
"""
try:
decoded_s = json_data.decode('utf-8')
decoded_s = json_data.decode('UTF-8')
data = json.loads(decoded_s, object_hook=Request._object_hook)

except UnicodeDecodeError as e:
Expand Down
2 changes: 1 addition & 1 deletion yandex_music/utils/request_async.py
Expand Up @@ -173,7 +173,7 @@ def _parse(self, json_data: bytes) -> Optional[Response]:
:class:`yandex_music.exceptions.YandexMusicError`: Базовое исключение библиотеки.
"""
try:
decoded_s = json_data.decode('utf-8')
decoded_s = json_data.decode('UTF-8')
data = json.loads(decoded_s, object_hook=Request._object_hook)

except UnicodeDecodeError as e:
Expand Down

0 comments on commit 8aafa15

Please sign in to comment.