Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-tweepy for openSUSE:Factory 
checked in at 2024-12-17 19:22:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-tweepy (Old)
 and      /work/SRC/openSUSE:Factory/.python-tweepy.new.29675 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-tweepy"

Tue Dec 17 19:22:49 2024 rev:16 rq:1231587 version:4.14.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-tweepy/python-tweepy.changes      
2024-03-13 22:20:25.496355065 +0100
+++ /work/SRC/openSUSE:Factory/.python-tweepy.new.29675/python-tweepy.changes   
2024-12-17 19:23:31.969849375 +0100
@@ -1,0 +2,8 @@
+Tue Dec 17 00:36:07 UTC 2024 - Steve Kowalik <[email protected]>
+
+- Add patch support-python-313.patch:
+  * Fall back to mimetypes if imghdr isn't available.
+- Add patch loosen-requests-oauthlib.patch:
+  * We can also work with requests-oauthlib < 3.
+
+-------------------------------------------------------------------

New:
----
  loosen-requests-oauthlib.patch
  support-python-313.patch

BETA DEBUG BEGIN:
  New:  * Fall back to mimetypes if imghdr isn't available.
- Add patch loosen-requests-oauthlib.patch:
  * We can also work with requests-oauthlib < 3.
  New:
- Add patch support-python-313.patch:
  * Fall back to mimetypes if imghdr isn't available.
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-tweepy.spec ++++++
--- /var/tmp/diff_new_pack.Ofuu36/_old  2024-12-17 19:23:32.821884835 +0100
+++ /var/tmp/diff_new_pack.Ofuu36/_new  2024-12-17 19:23:32.821884835 +0100
@@ -23,6 +23,10 @@
 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
 BuildRequires:  %{python_module aiohttp}
 BuildRequires:  %{python_module async-lru}
 BuildRequires:  %{python_module pip}
@@ -45,7 +49,7 @@
 API, and streaming API.
 
 %prep
-%setup -q -n tweepy-%{version}
+%autosetup -p1 -n tweepy-%{version}
 
 %build
 %pyproject_wheel

++++++ loosen-requests-oauthlib.patch ++++++
>From 5b43f6be94aad0ff248c07539def70883dd33462 Mon Sep 17 00:00:00 2001
From: Ryan Barrett <[email protected]>
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": [

++++++ support-python-313.patch ++++++
>From 1cd1f4e51948b20dea9814ba27dfda271f299b99 Mon Sep 17 00:00:00 2001
From: Christian Clauss <[email protected]>
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/'):

Reply via email to