Skip to content

Commit 2c18ac4

Browse files
committed
GLX-169: Fixes for Python 3.13, updated dependecies, pyproject.toml introduced
1 parent 6a1d276 commit 2c18ac4

34 files changed

+299
-222
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- name: Set up Python
1111
uses: actions/setup-python@v2
1212
with:
13-
python-version: 3.7
13+
python-version: 3.13
1414
- name: Install dependencies
1515
run: |
1616
python -m pip install --upgrade pip

.gitlab-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: registry-gitlab.gog.com/docker/python:3.7.3
1+
image: registry-gitlab.gog.com/docker/python:3.13
22

33
stages:
44
- test
@@ -18,10 +18,10 @@ deploy_package:
1818
TWINE_USERNAME: $PYPI_USERNAME
1919
TWINE_PASSWORD: $PYPI_PASSWORD
2020
script:
21-
- pip install twine wheel
21+
- pip install twine wheel build
2222
- rm -rf dist
2323
- export VERSION=$(python setup.py --version)
24-
- python setup.py sdist --formats=gztar bdist_wheel
24+
- python -m build --sdist --wheel
2525
- twine upload dist/*
2626
- curl -X POST --silent --show-error --fail
2727
"https://gitlab.gog.com/api/v4/projects/${CI_PROJECT_ID}/repository/tags?tag_name=${VERSION}&ref=${CI_COMMIT_REF_NAME}&private_token=${PACKAGE_DEPLOYER_API_TOKEN}"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ if __name__ == "__main__":
7272

7373
## Deployment
7474

75-
The client has a built-in Python 3.7 interpreter, so integrations are delivered as Python modules.
75+
The client has a built-in Python 3.13 interpreter, so integrations are delivered as Python modules.
7676
In order to be found by GOG Galaxy 2.0 an integration folder should be placed in [lookup directory](#deploy-location). Beside all the Python files, the integration folder must contain [manifest.json](#deploy-manifest) and all third-party dependencies. See an [exemplary structure](#deploy-structure-example).
7777

7878
### Lookup directory
@@ -88,7 +88,7 @@ In order to be found by GOG Galaxy 2.0 an integration folder should be placed in
8888
`~/Library/Application Support/GOG.com/Galaxy/plugins/installed`
8989

9090
### Logging
91-
<a href='https://docs.python.org/3.7/howto/logging.html'>Root logger</a> is already setup by GOG Galaxy to store rotated log files in:
91+
<a href='https://docs.python.org/3.13/howto/logging.html'>Root logger</a> is already setup by GOG Galaxy to store rotated log files in:
9292

9393
- Windows:
9494

@@ -128,9 +128,9 @@ Obligatory JSON file to be placed in an integration folder.
128128

129129
### Dependencies
130130

131-
All third-party packages (packages not included in the Python 3.7 standard library) should be deployed along with plugin files. Use the following command structure:
131+
All third-party packages (packages not included in the Python 3.13 standard library) should be deployed along with plugin files. Use the following command structure:
132132

133-
```pip install DEP --target DIR --implementation cp --python-version 37```
133+
```pip install DEP --target DIR --implementation cp --python-version 313```
134134

135135
For example, a plugin that uses *requests* could have the following structure:
136136

requirements-dev.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
-r requirements.txt
2-
pytest==5.2.2
3-
pytest-asyncio==0.10.0
4-
pytest-mock==1.10.3
5-
pytest-mypy==0.4.1
6-
pytest-flakes==4.0.0
7-
types-certifi==2020.4.0
2+
pytest==8.4.1
3+
pytest-asyncio==1.1.0
4+
pytest-mock==3.14.1
5+
pytest-mypy==1.0.1
6+
pytest-flakes==4.0.5
7+
types-certifi==2021.10.8.3
8+
setuptools==80.9.0

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-e .
22
# Copied from setup.py because of a pip bug
33
# see https://github.com/pypa/pip/issues/4780
4-
aiohttp==3.5.4
5-
certifi==2019.3.9
4+
aiohttp==3.12.15
5+
certifi==2025.8.3
66
psutil==5.6.6; sys_platform == 'darwin'
77
# End of copy from setup.py

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
setup(
44
name="galaxy.plugin.api",
5-
version="0.69",
5+
version="0.70",
66
description="GOG Galaxy Integrations Python API",
77
author='Galaxy team',
88
author_email='galaxy@gog.com',
99
packages=find_packages("src"),
1010
package_dir={'': 'src'},
11+
python_requires="~=3.13.0", # This package working with Python 3.13.x embedded in GOG Galaxy 2.0
1112
install_requires=[
12-
"aiohttp>=3.5.4",
13-
"certifi>=2019.3.9",
13+
"aiohttp>=3.12.15",
14+
"certifi>=2025.8.3",
1415
"psutil>=5.6.6; sys_platform == 'darwin'"
1516
]
1617
)

src/.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sphinx:
66
formats: all
77

88
python:
9-
version: 3.7
9+
version: 3.13
1010
install:
1111
- requirements: requirements.txt
1212
- requirements: docs/requirements.txt

src/galaxy/api/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from galaxy.api.jsonrpc import ApplicationError, UnknownError
22

3-
assert UnknownError
43

4+
assert UnknownError is not None # UnknownError not used directly in errors.py, but we want to ensure it's defined
55

66
class AuthenticationRequired(ApplicationError):
77
def __init__(self, message="Authentication required", data=None):

src/galaxy/api/importer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async def start(self, ids):
6161
context = await self._prepare_context(ids)
6262
self._task_manager.create_task(
6363
self._import_elements(ids, context),
64-
"{} import".format(self._name),
64+
f"{self._name} import",
6565
handle_exceptions=False
6666
)
6767
except:
@@ -76,7 +76,7 @@ def __init__(self, notification_partially_finished, *args):
7676

7777
async def _import_element(self, id_, context_):
7878
try:
79-
async for element in self._get(id_, context_):
79+
async for element in await self._get(id_, context_):
8080
self._notification_success(id_, element)
8181
except ApplicationError as error:
8282
self._notification_failure(id_, error)

src/galaxy/api/jsonrpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ async def handle():
297297
@staticmethod
298298
def _parse_message(data):
299299
try:
300-
jsonrpc_message = json.loads(data, encoding="utf-8")
300+
jsonrpc_message = json.loads(data)
301301
if jsonrpc_message.get("jsonrpc") != "2.0":
302302
raise InvalidRequest()
303303
del jsonrpc_message["jsonrpc"]

0 commit comments

Comments
 (0)