From 80ea39de3e57d64abf2804722b0e06cb5d25ecee8f5ecacc43cf431b98fc0af6 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 17 Nov 2025 01:02:24 +0000 Subject: [PATCH] - Add patch support-python314.patch: * Check for zstd support in the testsuite. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-twython?expand=0&rev=9 --- .gitattributes | 23 +++++++++++ .gitignore | 1 + python-twython.changes | 55 +++++++++++++++++++++++++++ python-twython.spec | 84 +++++++++++++++++++++++++++++++++++++++++ support-python314.patch | 19 ++++++++++ twython-3.9.1.tar.gz | 3 ++ 6 files changed, 185 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 python-twython.changes create mode 100644 python-twython.spec create mode 100644 support-python314.patch create mode 100644 twython-3.9.1.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/python-twython.changes b/python-twython.changes new file mode 100644 index 0000000..10efff5 --- /dev/null +++ b/python-twython.changes @@ -0,0 +1,55 @@ +------------------------------------------------------------------- +Mon Nov 17 01:01:38 UTC 2025 - Steve Kowalik + +- Add patch support-python314.patch: + * Check for zstd support in the testsuite. + +------------------------------------------------------------------- +Wed Jun 4 06:14:47 UTC 2025 - Steve Kowalik + +- Switch to pyproject macros. +- No more greedy globs in %files. + +------------------------------------------------------------------- +Tue Oct 11 16:19:03 UTC 2022 - Yogalakshmi Arunachalam + +- Update to version 3.9.1 + * Changes from raising StopIteration to returning instead. + * Updates information about Python 2.7 support drop. + +------------------------------------------------------------------- +Tue Jun 2 09:05:23 UTC 2020 - Marketa Calabkova + +- Update to version to 3.8.2 + * Bump release with latest patches from GitHub. + * Fix Direct Messages with patches from @manuelcortez. + * Use PyPI tarball again because upstream did not tag this release +- Drop upstreamed patch get_oembed_tweet-endpoint.patch +- Replace nose with pytest + +------------------------------------------------------------------- +Sat Mar 30 03:19:14 UTC 2019 - John Vandenberg + +- Use GitHub archive tarball +- Use %license +- Remove bcond test + +------------------------------------------------------------------- +Sat Feb 9 15:36:07 UTC 2019 - John Vandenberg + +- Update to v3.7.0 + - Fixes for cursoring API endpoints + - Improve html_for_tweet() parsing + - Documentation cleanup + - Documentation for cursor's return_pages keyword argument + - Update links to Twitter API in documentation + - Added create_metadata endpoint + - Raise error for when cursor is not provided a callable +- Add get_oembed_tweet-endpoint.patch + - Fixed the api end point in get_oembed_tweet +- Activate tests ignoring five failures + +------------------------------------------------------------------- +Tue Nov 7 18:25:42 UTC 2017 - toddrme2178@gmail.com + +- initial version v3.6.0 diff --git a/python-twython.spec b/python-twython.spec new file mode 100644 index 0000000..3f01770 --- /dev/null +++ b/python-twython.spec @@ -0,0 +1,84 @@ +# +# spec file for package python-twython +# +# Copyright (c) 2025 SUSE LLC and contributors +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: python-twython +Version: 3.9.1 +Release: 0 +Summary: Python wrapper for the Twitter API +License: MIT +URL: https://github.com/ryanmcgrath/twython +Source: https://files.pythonhosted.org/packages/source/t/twython/twython-%{version}.tar.gz +# PATCH-FIX-OPENSUSE Check for zstd compression support in a test +Patch0: support-python314.patch +# PyJWT 1.4.2 isnt compatible with single-spec +BuildRequires: %{python_module PyJWT > 1.4.2} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module requests >= 2.1.0} +BuildRequires: %{python_module requests-oauthlib >= 0.4.0} +BuildRequires: %{python_module responses} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-requests >= 2.1.0 +Requires: python-requests-oauthlib >= 0.4.0 +BuildArch: noarch +%python_subpackages + +%description +Twython is a Python library providing a way to access Twitter data. + +Features include: + +- Query data for: + - User information + - Twitter lists + - Timelines + - Direct Messages + - and anything found in `the docs `_ +- Image Uploading: + - Update user status with an image + - Change user avatar + - Change user background image + - Change user banner image +- OAuth 2 Application Only (read-only) Support +- Support for Twitter's Streaming API +- Seamless Python 3 support! + +%prep +%autosetup -p1 -n twython-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +# Five failing tests +%pytest -k "not (test_get_lastfunction_header_should_return_header or test_request_should_handle_40 or test_request_should_handle_rate_limit)" + +%files %{python_files} +%doc README.md +%license LICENSE +%{python_sitelib}/twython +%{python_sitelib}/twython-%{version}.dist-info + +%changelog diff --git a/support-python314.patch b/support-python314.patch new file mode 100644 index 0000000..8cb18e1 --- /dev/null +++ b/support-python314.patch @@ -0,0 +1,19 @@ +Index: twython-3.9.1/tests/test_core.py +=================================================================== +--- twython-3.9.1.orig/tests/test_core.py ++++ twython-3.9.1/tests/test_core.py +@@ -285,7 +285,13 @@ class TwythonAPITestCase(unittest.TestCa + + self.api.get(endpoint) + +- self.assertEqual(b'gzip, deflate', responses.calls[0].request.headers['Accept-Encoding']) ++ accept_encoding = b'gzip, deflate' ++ try: ++ import compression.zstd ++ accept_encoding += b', zstd' ++ except ImportError: ++ pass ++ self.assertEqual(accept_encoding, responses.calls[0].request.headers['Accept-Encoding']) + + # Static methods + def test_construct_api_url(self): diff --git a/twython-3.9.1.tar.gz b/twython-3.9.1.tar.gz new file mode 100644 index 0000000..f52902d --- /dev/null +++ b/twython-3.9.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a3f0ac24d10705257028fb4205bfedf432ff28d358b796e0c2f01a2f9990c84 +size 376877