14
0
forked from pool/python-tweepy

Accepting request 1240755 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/1240755
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-tweepy?expand=0&rev=17
This commit is contained in:
2025-01-28 13:59:49 +00:00
committed by Git OBS Bridge
7 changed files with 42 additions and 88 deletions

22
fix-package-version.patch Normal file
View File

@@ -0,0 +1,22 @@
From c1eb4f3f7bfaf5a54db73ae28f7395e8cbf01752 Mon Sep 17 00:00:00 2001
From: Josh Roesslein <jroesslein@gmail.com>
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'

View File

@@ -1,22 +0,0 @@
From 5b43f6be94aad0ff248c07539def70883dd33462 Mon Sep 17 00:00:00 2001
From: Ryan Barrett <git@ryanb.org>
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": [

View File

@@ -1,3 +1,16 @@
-------------------------------------------------------------------
Tue Jan 28 09:08:40 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- 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 <steven.kowalik@suse.com>

View File

@@ -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}

View File

@@ -1,57 +0,0 @@
From 1cd1f4e51948b20dea9814ba27dfda271f299b99 Mon Sep 17 00:00:00 2001
From: Christian Clauss <cclauss@me.com>
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/'):

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ad30f817b746b4519f40af2f6577624cf7775d4e9379c559cc7d1099702eb921
size 5914530

3
v4.15.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f09870b501d8a7152cb87d14254172f72fad066c95fb49ef4a9ed0b60489d9ab
size 5916084