From af538da8db588de9b94eb43cab484a0baa4e30450031e6a5347fff89ec547b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Tue, 11 Sep 2018 13:45:03 +0000 Subject: [PATCH] Accepting request 634935 from home:mcepl:work - Switch to multibuild to minize requirements for providing urllib3 module. OBS-URL: https://build.opensuse.org/request/show/634935 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urllib3?expand=0&rev=51 --- _multibuild | 3 +++ python-urllib3.changes | 6 ++++++ python-urllib3.spec | 33 ++++++++++++++++++++++++++++----- 3 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 _multibuild diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/python-urllib3.changes b/python-urllib3.changes index 4b68d73..5d229d1 100644 --- a/python-urllib3.changes +++ b/python-urllib3.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Sep 7 14:45:38 CEST 2018 - mcepl@suse.com + +- Switch to multibuild to minize requirements for providing + urllib3 module. + ------------------------------------------------------------------- Tue Aug 21 11:39:09 UTC 2018 - dmueller@suse.com diff --git a/python-urllib3.spec b/python-urllib3.spec index b22cda0..d9663df 100644 --- a/python-urllib3.spec +++ b/python-urllib3.spec @@ -18,7 +18,19 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define oldpython python + +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define test 1 +%bcond_without test +%else +%bcond_with test +%endif +%if %{with test} +Name: python-urllib3-%{flavor} +%else Name: python-urllib3 +%endif Version: 1.23 Release: 0 Summary: HTTP library with thread-safe connection pooling, file post, and more @@ -36,12 +48,15 @@ Patch3: urllib3-test-ssl-drop-sslv3.patch # PATCH-FIX-UPSTREAM python-urllib3-recent-date.patch gh#shazow/urllib3#1303, boo#1074247 dimstar@opensuse.org -- Fix test suite, use correct date Patch4: python-urllib3-recent-date.patch BuildRequires: %{python_module PySocks} -BuildRequires: %{python_module mock >= 1.3.0} BuildRequires: %{python_module psutil} -BuildRequires: %{python_module pytest} -BuildRequires: %{python_module tornado >= 4.2.1} +BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +%if %{with test} +BuildRequires: %{python_module mock >= 1.3.0} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module tornado >= 4.2.1} +%endif #!BuildIgnore: python-requests BuildArch: noarch %if 0%{?suse_version} >= 1000 || 0%{?fedora_version} >= 24 @@ -90,10 +105,14 @@ find . -type f -exec chmod a-x '{}' \; %install %python_install -%python_expand %fdupes %{buildroot}%{$python_sitelib} +%{python_expand \ +$python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/urllib3/ +$python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/urllib3/ +%fdupes %{buildroot}%{$python_sitelib} +} %check - +%if %{with test} skiplist='not test_select_interrupt_exception and not test_selector_error and not timeout and not test_request_host_header_ignores_fqdn_dot and not test_dotted_fqdn' case $(uname -m) in ppc*) @@ -109,11 +128,15 @@ export TRAVIS=1 --ignore=test/with_dummyserver/test_poolmanager.py \ -k "${skiplist}" \ urllib3 test} +rm -rf %{buildroot}%{_libexecdir}/python* +%endif %files %{python_files} %license LICENSE.txt %doc CHANGES.rst CONTRIBUTORS.txt README.rst +%if ! %{with test} %{python_sitelib}/urllib3 %{python_sitelib}/urllib3-%{version}-py*.egg-info +%endif %changelog