From 1e7e46fb77b443975a5524ad3192c9ce1214b398 Mon Sep 17 00:00:00 2001 From: mkovalua Date: Tue, 3 Jun 2025 16:22:41 +0300 Subject: [PATCH 1/4] [tool:pytest] is a way to work with python3.13 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index f4a03a181..950c7f901 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,5 +10,5 @@ ignore = E501,E127,E128,E265,E301,E302,F403,E731 max-line-length = 100 exclude = .ropeproject,tests/*,src/*,env,venv,node_modules/* -[pytest] +[tool:pytest] norecursedirs = .* build CVS _darcs {arch} *.egg venv node_modules/* From 1476ce7c116fc68d9b47483a7e49a4a7a75310ba Mon Sep 17 00:00:00 2001 From: mkovalua Date: Wed, 4 Jun 2025 14:52:22 +0300 Subject: [PATCH 2/4] update test requirements * make it possible to run unittest tests * add '__init__.py' into tests/core to avoid import errors --- requirements.txt | 16 +++++++++++----- tests/core/__init__.py | 0 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 tests/core/__init__.py diff --git a/requirements.txt b/requirements.txt index 7929d67f7..4d4787419 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,15 +24,15 @@ pydocx==0.9.10 # Image olefile==0.44 Pillow==11.0.0 -psd-tools==1.4 +psd-tools==1.10.7 # IPython ipython==7.31.1 -nbconvert==4.2.0 -nbformat==4.1.0 -traitlets==4.2.2 +nbconvert==6.4.0 +nbformat==5.1.3 +traitlets==5.0 jsonschema==2.4.0 -jinja2==2.10.1 +jinja2==3.0.0 mistune==0.8.1 # Pdf @@ -54,3 +54,9 @@ scipy==1.14.1 markdown==3.8.0 certifi==2025.1.31 + + +markupsafe==2.0.1 + +# Standard library imghdr redistribution because it is not supported in python 3.13. +standard-imghdr==3.13.0 diff --git a/tests/core/__init__.py b/tests/core/__init__.py new file mode 100644 index 000000000..e69de29bb From 2a561f2fcc1685b3f62bdece822c8355096785ce Mon Sep 17 00:00:00 2001 From: mkovalua Date: Wed, 4 Jun 2025 15:48:40 +0300 Subject: [PATCH 3/4] fix bad async with call for py3.13 * Update `async with await aiohttp.request` -> `async with aiohttp.request` --- mfr/core/remote_logging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mfr/core/remote_logging.py b/mfr/core/remote_logging.py index e98dad7e8..42c105e27 100644 --- a/mfr/core/remote_logging.py +++ b/mfr/core/remote_logging.py @@ -113,7 +113,7 @@ async def _send_to_keen(payload, collection, project_id, write_key, action, doma settings.KEEN_API_VERSION, project_id, collection) - async with await aiohttp.request('POST', url, headers=headers, data=serialized) as resp: + async with aiohttp.request('POST', url, headers=headers, data=serialized) as resp: if resp.status == 201: logger.info(f'Successfully logged {action} to {collection} collection in {domain} Keen') else: From 9ab77aed3e06832592df097801bd5656de3d4322 Mon Sep 17 00:00:00 2001 From: mkovalua Date: Wed, 4 Jun 2025 15:53:51 +0300 Subject: [PATCH 4/4] replace ContentEncodingError for python3.13 * ContentEncodingError has been replaced with except Exception: (maybe some additional logic is needed for pass and more strict Exception class ) --- mfr/providers/osf/provider.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mfr/providers/osf/provider.py b/mfr/providers/osf/provider.py index 32fe2b485..99affc9fd 100644 --- a/mfr/providers/osf/provider.py +++ b/mfr/providers/osf/provider.py @@ -7,7 +7,6 @@ import furl import aiohttp -from aiohttp.errors import ContentEncodingError from waterbutler.core import streams @@ -92,7 +91,7 @@ async def metadata(self): try: metadata = {'data': json.loads(response_headers['x-waterbutler-metadata'])['attributes']} - except ContentEncodingError: + except Exception: pass # hack: aiohttp tries to unzip empty body when Content-Encoding is set self.metrics.add('metadata.raw', metadata)