From ddff96060a30e9a853617cb8867ec766f01927b5b9d08c9ea71d2a3de53225a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 28 Jan 2025 10:24:53 +0000 Subject: [PATCH] Accepting request 1240734 from home:glaubitz:branches:devel:languages:python - Update to 4.15.0 * Fix error "No module named 'imghdr'" due to removed package in Python 3.13+ * Bump requests-oauthlib to allow v2 * Drop support for Python 3.7 and 3.8 - Cherry-pick upstream patch to fix package version * fix-package-version.patch - Drop loosen-requests-oauthlib.patch, merged upstream - Drop support-python-313.patch, merged upstream OBS-URL: https://build.opensuse.org/request/show/1240734 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tweepy?expand=0&rev=34 --- fix-package-version.patch | 22 +++++++++++++ loosen-requests-oauthlib.patch | 22 ------------- python-tweepy.changes | 13 ++++++++ python-tweepy.spec | 10 +++--- support-python-313.patch | 57 ---------------------------------- v4.14.0.tar.gz | 3 -- v4.15.0.tar.gz | 3 ++ 7 files changed, 42 insertions(+), 88 deletions(-) create mode 100644 fix-package-version.patch delete mode 100644 loosen-requests-oauthlib.patch delete mode 100644 support-python-313.patch delete mode 100644 v4.14.0.tar.gz create mode 100644 v4.15.0.tar.gz diff --git a/fix-package-version.patch b/fix-package-version.patch new file mode 100644 index 0000000..0d802fd --- /dev/null +++ b/fix-package-version.patch @@ -0,0 +1,22 @@ +From c1eb4f3f7bfaf5a54db73ae28f7395e8cbf01752 Mon Sep 17 00:00:00 2001 +From: Josh Roesslein +Date: Wed, 15 Jan 2025 15:24:21 -0600 +Subject: [PATCH] Bump version number to 4.15.0 + +--- + tweepy/__init__.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tweepy/__init__.py b/tweepy/__init__.py +index efe98645b..105189c08 100644 +--- a/tweepy/__init__.py ++++ b/tweepy/__init__.py +@@ -5,7 +5,7 @@ + """ + Tweepy Twitter API library + """ +-__version__ = '4.14.0' ++__version__ = '4.15.0' + __author__ = 'Joshua Roesslein' + __license__ = 'MIT' + diff --git a/loosen-requests-oauthlib.patch b/loosen-requests-oauthlib.patch deleted file mode 100644 index 5f29693..0000000 --- a/loosen-requests-oauthlib.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 5b43f6be94aad0ff248c07539def70883dd33462 Mon Sep 17 00:00:00 2001 -From: Ryan Barrett -Date: Thu, 11 Apr 2024 09:48:38 -0700 -Subject: [PATCH] deps: bump requests-oauthlib to <3 to allow v2.0.0 - ---- - setup.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/setup.py b/setup.py -index 50548a312..c097abfe2 100644 ---- a/setup.py -+++ b/setup.py -@@ -36,7 +36,7 @@ - install_requires=[ - "oauthlib>=3.2.0,<4", - "requests>=2.27.0,<3", -- "requests-oauthlib>=1.2.0,<2", -+ "requests-oauthlib>=1.2.0,<3", - ], - extras_require={ - "async": [ diff --git a/python-tweepy.changes b/python-tweepy.changes index e87b57e..11a866d 100644 --- a/python-tweepy.changes +++ b/python-tweepy.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Tue Jan 28 09:08:40 UTC 2025 - John Paul Adrian Glaubitz + +- Update to 4.15.0 + * Fix error "No module named 'imghdr'" due to removed + package in Python 3.13+ + * Bump requests-oauthlib to allow v2 + * Drop support for Python 3.7 and 3.8 +- Cherry-pick upstream patch to fix package version + * fix-package-version.patch +- Drop loosen-requests-oauthlib.patch, merged upstream +- Drop support-python-313.patch, merged upstream + ------------------------------------------------------------------- Tue Dec 17 00:36:07 UTC 2024 - Steve Kowalik diff --git a/python-tweepy.spec b/python-tweepy.spec index ace71cf..75d9ecd 100644 --- a/python-tweepy.spec +++ b/python-tweepy.spec @@ -1,7 +1,7 @@ # # spec file for package python-tweepy # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,16 +17,14 @@ Name: python-tweepy -Version: 4.14.0 +Version: 4.15.0 Release: 0 Summary: Twitter library for python License: MIT URL: https://github.com/tweepy/tweepy Source: https://github.com/tweepy/tweepy/archive/v%{version}.tar.gz -# PATCH-FIX-UPSTREAM Based on gh#tweepy/tweepy#2205 -Patch0: support-python-313.patch -# PATCH-FIX-UPSTREAM gh#tweepy/tweepy#2179 -Patch1: loosen-requests-oauthlib.patch +# PATCH-FIX-UPSTREAM: Bump version number to 4.15.0 +Patch: https://github.com/tweepy/tweepy/commit/c1eb4f3f7bfaf5a54db73ae28f7395e8cbf01752.patch#/fix-package-version.patch BuildRequires: %{python_module aiohttp} BuildRequires: %{python_module async-lru} BuildRequires: %{python_module pip} diff --git a/support-python-313.patch b/support-python-313.patch deleted file mode 100644 index b58f201..0000000 --- a/support-python-313.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 1cd1f4e51948b20dea9814ba27dfda271f299b99 Mon Sep 17 00:00:00 2001 -From: Christian Clauss -Date: Sat, 11 May 2024 07:24:17 +0200 -Subject: [PATCH 1/2] GitHub Actions: Test on Python 3.13 beta - -https://www.python.org/downloads/release/python-3130b1/ - -Raises an error because https://docs.python.org/3/library/imghdr.html was removed from the Standard Library in Python 3.13. ---- - .github/workflows/test.yml | 7 ++++--- - tests/test_api.py | 4 ++++ - tweepy/api.py | 5 ++++- - 3 files changed, 12 insertions(+), 4 deletions(-) - -Index: tweepy-4.14.0/tweepy/api.py -=================================================================== ---- tweepy-4.14.0.orig/tweepy/api.py -+++ tweepy-4.14.0/tweepy/api.py -@@ -4,7 +4,6 @@ - - import contextlib - import functools --import imghdr - import logging - import mimetypes - from platform import python_version -@@ -3382,15 +3381,22 @@ class API: - ---------- - https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/overview - """ -- h = None -- if file is not None: -- location = file.tell() -- h = file.read(32) -- file.seek(location) -- file_type = imghdr.what(filename, h=h) -- if file_type is not None: -- file_type = 'image/' + file_type -+ file_type = None -+ try: -+ import imghdr -+ except ModuleNotFoundError: -+ # imghdr was removed in Python 3.13 -+ pass - else: -+ h = None -+ if file is not None: -+ location = file.tell() -+ h = file.read(32) -+ file.seek(location) -+ file_type = imghdr.what(filename, h=h) -+ if file_type is not None: -+ file_type = 'image/' + file_type -+ if file_type is None: - file_type = mimetypes.guess_type(filename)[0] - - if chunked or file_type.startswith('video/'): diff --git a/v4.14.0.tar.gz b/v4.14.0.tar.gz deleted file mode 100644 index 3fdd6e0..0000000 --- a/v4.14.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ad30f817b746b4519f40af2f6577624cf7775d4e9379c559cc7d1099702eb921 -size 5914530 diff --git a/v4.15.0.tar.gz b/v4.15.0.tar.gz new file mode 100644 index 0000000..925c263 --- /dev/null +++ b/v4.15.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f09870b501d8a7152cb87d14254172f72fad066c95fb49ef4a9ed0b60489d9ab +size 5916084