# # spec file for package python-requests-toolbelt # # Copyright (c) 2023 SUSE LLC # # 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/ # %define skip_python2 1 %define skip_python36 1 %define skip_python38 1 %define skip_python39 1 %define skip_python311 1 %{?sle15_python_module_pythons} Name: python-requests-toolbelt Version: 1.0.0 Release: 1.2 Summary: A utility belt for advanced users of python3-requests License: Apache-2.0 URL: https://github.com/requests/toolbelt Source: https://files.pythonhosted.org/packages/source/r/requests-toolbelt/requests-toolbelt-%{version}.tar.gz # Replace expired test certificate Source1: test_cert.p12 # PATCH-FIX-OPENSUSE Stop using PyOpenSSLCompat, it generates widespread # DeprecationWarnings Patch0: stop-using-pyopenssl-compat.patch # PATCH-FIX-UPSTREAM 356-add-missing-casette-files.patch gh#requests/toolbelt!356 mcepl@suse.com # add missing casette files Patch1: 356-add-missing-casette-files.patch BuildRequires: %{python_module requests >= 2.12.2} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-requests >= 2.12.2 BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module betamax >= 0.5.0} # gh#pyca/cryptography#5606 BuildRequires: %{python_module pyOpenSSL >= 19.1.0} BuildRequires: %{python_module pytest} BuildRequires: %{python_module trustme} %if 0%{?suse_version} <= 1500 BuildRequires: python-mock %endif # /SECTION %python_subpackages %description This is just a collection of utilities for `python-requests`_, but don't really belong in ``requests`` proper. The minimum tested requests version is ``2.1.0``. In reality, the toolbelt should work with ``2.0.1`` as well, but some idiosyncracies prevent effective or sane testing on that version. %prep %autosetup -p1 -n requests-toolbelt-%{version} cp %{SOURCE1} tests/certs rm -rf requests_toolbelt.egg-info %build %python_build %install %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check # Relax the crypto policies for the test-suite export OPENSSL_SYSTEM_CIPHERS_OVERRIDE=xyz_nonexistent_file export OPENSSL_CONF='' # Requires network access %pytest # -k 'not network' %files %{python_files} %license LICENSE %doc README.rst %{python_sitelib}/requests_toolbelt %{python_sitelib}/requests_toolbelt-%{version}*-info %changelog * Thu May 4 2023 Matej Cepl - Upgrade to 1.0.0: - Breaking Changes - Removed Google App Engine support to allow using urllib3 2.0 - New Features - Add support for preparing requests in BaseUrlSession - Fixed Bugs - Ensured the test suite no longer reaches the Internet - Fix urllib3 warning to only emit on X509Adapter usage - Fixing missing newline in dump utility - Miscellaneous - Added explicit support for Python 3.11 - Remove upstreamed patches: - fix-tests.patch - remove_mock.patch - requests-toolbelt-pr246-collections.abc.patch - Add 356-add-missing-casette-files.patch which adds missing casette test files (gh#requests/toolbelt!356). * Fri Apr 21 2023 Dirk Müller - add sle15_python_module_pythons (jsc#PED-68) * Thu Apr 13 2023 Matej Cepl - Make calling of %%{sle15modernpython} optional. * Fri Sep 30 2022 Steve Kowalik - Add patch stop-using-pyopenssl-compat.patch: * Stop importing (and using!) a pyopenssl compatibility module to avoid a DeprecationWarning. * Wed Mar 2 2022 Steve Kowalik - Properly redo the regeneration of test_certs.p12. * Sat Dec 11 2021 Ben Greiner - Fix python310 failure due to moved collections.abc * add requests-toolbelt-pr246-collections.abc.patch * gh#requests/toolbelt#246 * Mon Nov 29 2021 Steve Kowalik - Regenerate test_certs.p12 due to the upstream certificate expiring * Thu Feb 11 2021 Pedro Monreal - Relax the crypto policies for the test-suite * Mon Dec 14 2020 Benjamin Greiner - Fix condition around BuildRequirement * Sun Dec 13 2020 Matej Cepl - We don't need to break Python 2.7 * Mon Dec 7 2020 Matej Cepl - Add remove_mock.patch to remove dependency on the external mock * Mon May 6 2019 Tomáš Chvátal - Add patch to fix tests fix-tests.patch - Use pytest to execute the tests, same as the upstream * Thu Apr 25 2019 Dirk Mueller - update to 0.9.1: - Fix import of pyOpenSSL shim from urllib3 for PKCS12 adapter - Add X509 Adapter that can handle PKCS12 - Add stateless solution for streaming files by MultipartEncoder from one host to another (in chunks) - Update link to example - Move import of ``ABCs`` from collections into version-specific part of _compat module - Fix backwards incompatibility in ``get_encodings_from_content`` - Correct callback documentation for ``MultipartEncoderMonitor`` - Fix bug when ``MultipartEncoder`` is asked to encode zero parts - Correct the type of non string request body dumps - Removed content from being stored in MultipartDecoder - Fix bug by enabling support for contenttype with capital letters. - Coerce proxy URL to bytes before dumping request - Avoid bailing out with exception upon empty response reason - Corrected Pool documentation - Corrected parentheses match in example usage - Fix "oject" to "object" in ``MultipartEncoder`` - Fix URL for the project after the move - Add fix for OSX TCPKeepAliveAdapter * Fri Jun 30 2017 aloisio@gmx.com - Update to version 0.8.0 (see HISTORY.rst) - Converted to single-spec * Tue May 16 2017 dmueller@suse.com - convert to singlespec * Thu Jan 19 2017 dmueller@suse.com - use pypi.io source link * Wed Jan 18 2017 michael@stroeder.com - update to upstream release 0.7.0 - simply rely on python_sitelib macro when installing files * Mon Jul 13 2015 toddrme2178@gmail.com - Fix building on SLES 11 * Mon Nov 17 2014 seiler@b1-systems.de - added explicit version dependency for python-request to avoid build errors for old distributions * Thu Nov 13 2014 seiler@b1-systems.de - added python-requests to build requirements to do python tests * Wed Nov 5 2014 seiler@b1-systems.de - inital commit