From 1a4a56e41c97fba11d0d1c9b569e4e6d52ac8cd2ce3293efa6c45f04457efd87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 23 Apr 2019 10:46:50 +0000 Subject: [PATCH] - Do not hardcode version requirements in setup.py allowing us to update and verify functionality on our own: * requests-no-hardcoded-version.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-requests?expand=0&rev=128 --- python-requests.changes | 7 +++++++ python-requests.spec | 6 +++++- requests-no-hardcoded-version.patch | 23 +++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 requests-no-hardcoded-version.patch diff --git a/python-requests.changes b/python-requests.changes index df8d991..1c5b20a 100644 --- a/python-requests.changes +++ b/python-requests.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Apr 23 10:45:08 UTC 2019 - Tomáš Chvátal + +- Do not hardcode version requirements in setup.py allowing us to + update and verify functionality on our own: + * requests-no-hardcoded-version.patch + ------------------------------------------------------------------- Mon Feb 25 15:45:08 UTC 2019 - Tomáš Chvátal diff --git a/python-requests.spec b/python-requests.spec index b6c43f4..864adc2 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -33,6 +33,8 @@ License: Apache-2.0 Group: Development/Languages/Python URL: http://python-requests.org/ Source: https://files.pythonhosted.org/packages/source/r/requests/requests-%{version}.tar.gz +# PATCH-FIX-SUSE: do not hardcode versions in setup.py/requirements +Patch0: requests-no-hardcoded-version.patch BuildRequires: %{python_module certifi} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module urllib3 >= 1.21.1} @@ -61,6 +63,7 @@ Recommends: python-pyOpenSSL >= 0.14 %endif %if %{with test} BuildRequires: %{python_module PySocks >= 1.5.6} +BuildRequires: %{python_module brotlipy} BuildRequires: %{python_module chardet >= 3.0.2} BuildRequires: %{python_module idna >= 2.5} BuildRequires: %{python_module pytest-httpbin >= 0.0.7} @@ -90,6 +93,7 @@ Features of Requests: %prep %setup -q -n requests-%{version} +%patch0 -p1 # drop shebang from certs.py sed -i '1s/^#!.*$//' requests/certs.py @@ -116,7 +120,7 @@ test ! -e %{buildroot}%{python3_sitelib}/requests/packages/urllib3 touch Pipfile # exclude tests connecting to TARPIT # exclude test_https_warnings as is flaky -%python_exec -m pytest tests -k "not (TestTimeout or connect or test_https_warnings)" +%python_exec -m pytest -v tests -k "not (TestTimeout or connect or test_https_warnings)" %endif %if !%{with test} diff --git a/requests-no-hardcoded-version.patch b/requests-no-hardcoded-version.patch new file mode 100644 index 0000000..bd3968b --- /dev/null +++ b/requests-no-hardcoded-version.patch @@ -0,0 +1,23 @@ +Index: requests-2.21.0/setup.py +=================================================================== +--- requests-2.21.0.orig/setup.py ++++ requests-2.21.0/setup.py +@@ -42,14 +42,14 @@ if sys.argv[-1] == 'publish': + packages = ['requests'] + + requires = [ +- 'chardet>=3.0.2,<3.1.0', +- 'idna>=2.5,<2.9', +- 'urllib3>=1.21.1,<1.25', ++ 'chardet>=3.0.2', ++ 'idna>=2.5', ++ 'urllib3>=1.21.1', + 'certifi>=2017.4.17' + + ] + test_requirements = [ +- 'pytest-httpbin==0.0.7', ++ 'pytest-httpbin>=0.0.7', + 'pytest-cov', + 'pytest-mock', + 'pytest-xdist',