From 525e5b10263960523c038186b602665399a62d13 Mon Sep 17 00:00:00 2001 From: Divya Dusi Date: Mon, 21 Jul 2025 15:15:38 -0400 Subject: [PATCH 1/2] Fix Python 3.12 compatibility: remove use_2to3, fix urllib imports, update classifiers --- embedly/__init__.py | 2 +- embedly/client.py | 11 ++++++++--- setup.py | 15 +++++++++------ 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/embedly/__init__.py b/embedly/__init__.py index 11f965c..790df6b 100644 --- a/embedly/__init__.py +++ b/embedly/__init__.py @@ -1,4 +1,4 @@ from __future__ import absolute_import from .client import Embedly -__version__ = '0.5.0.post0' +__version__ = '0.5.0.post1-python3.12' diff --git a/embedly/client.py b/embedly/client.py index 3aff738..1dc5c5d 100644 --- a/embedly/client.py +++ b/embedly/client.py @@ -8,7 +8,12 @@ import re import httplib2 import json -from urllib import quote, urlencode +try: + # Python 3 + from urllib.parse import quote, urlencode +except ImportError: + # Python 2 + from urllib import quote, urlencode from .models import Url @@ -142,8 +147,8 @@ def _get(self, version, method, url_or_urls, **kwargs): 'error_code': int(resp['status'])} if multi: - return map(lambda url, data: Url(data, method, url), - url_or_urls, data) + return list(map(lambda url, data: Url(data, method, url), + url_or_urls, data)) return Url(data, method, url_or_urls) diff --git a/setup.py b/setup.py index e0fef44..73ed039 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ def get_version(): tests_require=tests_require, test_suite="embedly.tests", zip_safe=True, - use_2to3=True, + # Removed use_2to3=True for Python 3.12 compatibility classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', @@ -50,9 +50,12 @@ def get_version(): 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', - ] + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + ], + python_requires='>=3.8', ) From 7a12d1da13df07895ac24ca90c899876d377e9cb Mon Sep 17 00:00:00 2001 From: Divya Dusi Date: Mon, 21 Jul 2025 15:26:48 -0400 Subject: [PATCH 2/2] Fix version number to be PEP 440 compliant --- embedly/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embedly/__init__.py b/embedly/__init__.py index 790df6b..ab5d75f 100644 --- a/embedly/__init__.py +++ b/embedly/__init__.py @@ -1,4 +1,4 @@ from __future__ import absolute_import from .client import Embedly -__version__ = '0.5.0.post1-python3.12' +__version__ = '0.5.0.post1'