forked from pool/python-pip
		
	Accepting request 848968 from devel:languages:python
- Actually, test the new structure of package. :$ - Remove the additional sourced setuptools*.whl and use BR on python-setuptools-wheel. - Add wheel subpackage with the generated wheel for this package (bsc#1176262, CVE-2019-20916). - Make wheel a separate build run to avoid the setuptools/wheel build cycle. OBS-URL: https://build.opensuse.org/request/show/848968 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pip?expand=0&rev=51
This commit is contained in:
		@@ -1,3 +1,4 @@
 | 
			
		||||
<multibuild>
 | 
			
		||||
  <package>test</package>
 | 
			
		||||
  <package>wheel</package>
 | 
			
		||||
</multibuild>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,18 @@
 | 
			
		||||
-------------------------------------------------------------------
 | 
			
		||||
Mon Nov 16 16:37:45 UTC 2020 - Matej Cepl <mcepl@suse.com>
 | 
			
		||||
 | 
			
		||||
- Actually, test the new structure of package. :$
 | 
			
		||||
- Remove the additional sourced setuptools*.whl and use BR on
 | 
			
		||||
  python-setuptools-wheel.
 | 
			
		||||
 | 
			
		||||
-------------------------------------------------------------------
 | 
			
		||||
Fri Nov 13 18:51:09 UTC 2020 - Matej Cepl <mcepl@suse.com>
 | 
			
		||||
 | 
			
		||||
- Add wheel subpackage with the generated wheel for this package
 | 
			
		||||
  (bsc#1176262, CVE-2019-20916).
 | 
			
		||||
- Make wheel a separate build run to avoid the setuptools/wheel build
 | 
			
		||||
  cycle.
 | 
			
		||||
 | 
			
		||||
-------------------------------------------------------------------
 | 
			
		||||
Fri Oct 30 00:18:04 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -21,9 +21,16 @@
 | 
			
		||||
%if "%{flavor}" == "test"
 | 
			
		||||
%define psuffix -test
 | 
			
		||||
%bcond_without test
 | 
			
		||||
%bcond_with wheel
 | 
			
		||||
%else
 | 
			
		||||
%if "%{flavor}" == "wheel"
 | 
			
		||||
%define psuffix -wheel
 | 
			
		||||
%bcond_without wheel
 | 
			
		||||
%else
 | 
			
		||||
%define psuffix %{nil}
 | 
			
		||||
%bcond_with test
 | 
			
		||||
%bcond_with wheel
 | 
			
		||||
%endif
 | 
			
		||||
%endif
 | 
			
		||||
Name:           python-pip%{psuffix}
 | 
			
		||||
Version:        20.2.3
 | 
			
		||||
@@ -33,9 +40,6 @@ License:        MIT
 | 
			
		||||
URL:            http://www.pip-installer.org
 | 
			
		||||
# The PyPI archive lacks the tests
 | 
			
		||||
Source:         https://github.com/pypa/pip/archive/%{version}.tar.gz#/pip-%{version}-gh.tar.gz
 | 
			
		||||
# Wheel used for testing, no need to update regularly beyond the minimum version specified in 
 | 
			
		||||
# tools/requirements/tests-common_wheels.txt
 | 
			
		||||
Source1:        https://files.pythonhosted.org/packages/py3/s/setuptools/setuptools-45.1.0-py3-none-any.whl
 | 
			
		||||
# PATCH-FIX-OPENSUSE pip-shipped-requests-cabundle.patch -- adapted patch from python-certifi package
 | 
			
		||||
Patch0:         pip-shipped-requests-cabundle.patch
 | 
			
		||||
BuildRequires:  %{python_module setuptools >= 40.8.0}
 | 
			
		||||
@@ -61,12 +65,16 @@ BuildRequires:  %{python_module mock}
 | 
			
		||||
BuildRequires:  %{python_module pretend}
 | 
			
		||||
BuildRequires:  %{python_module pytest}
 | 
			
		||||
BuildRequires:  %{python_module scripttest}
 | 
			
		||||
BuildRequires:  %{python_module setuptools-wheel}
 | 
			
		||||
BuildRequires:  %{python_module virtualenv >= 1.10}
 | 
			
		||||
BuildRequires:  %{python_module wheel}
 | 
			
		||||
BuildRequires:  ca-certificates
 | 
			
		||||
BuildRequires:  git
 | 
			
		||||
BuildRequires:  subversion
 | 
			
		||||
%endif
 | 
			
		||||
%if %{with wheel}
 | 
			
		||||
BuildRequires:  %{python_module wheel}
 | 
			
		||||
%endif
 | 
			
		||||
%python_subpackages
 | 
			
		||||
 | 
			
		||||
%description
 | 
			
		||||
@@ -83,7 +91,7 @@ rm src/pip/_vendor/certifi/cacert.pem
 | 
			
		||||
 | 
			
		||||
%if %{with test}
 | 
			
		||||
mkdir -p tests/data/common_wheels
 | 
			
		||||
cp %{SOURCE1} tests/data/common_wheels/
 | 
			
		||||
%python_expand cp %{$python_sitelib}/../wheels/setuptools*.whl tests/data/common_wheels/
 | 
			
		||||
%endif
 | 
			
		||||
# remove shebangs verbosely (if only sed would offer a verbose mode...)
 | 
			
		||||
for f in $(find src -name \*.py -exec grep -l '^#!%{_bindir}/env' {} \;); do
 | 
			
		||||
@@ -91,9 +99,13 @@ for f in $(find src -name \*.py -exec grep -l '^#!%{_bindir}/env' {} \;); do
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
%build
 | 
			
		||||
%if ! %{with wheel}
 | 
			
		||||
%python_build
 | 
			
		||||
%else
 | 
			
		||||
%python_exec setup.py bdist_wheel --universal
 | 
			
		||||
%endif
 | 
			
		||||
 | 
			
		||||
%if ! %{with test}
 | 
			
		||||
%if !%{with test} && !%{with wheel}
 | 
			
		||||
%install
 | 
			
		||||
%python_install
 | 
			
		||||
%python_clone -a %{buildroot}%{_bindir}/pip
 | 
			
		||||
@@ -103,6 +115,10 @@ rm -f %{buildroot}%{_bindir}/pip3-2*
 | 
			
		||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
 | 
			
		||||
%endif
 | 
			
		||||
 | 
			
		||||
%if %{with wheel}
 | 
			
		||||
%python_expand install -D -m 0644 -t %{buildroot}%{$python_sitelib}/../wheels dist/*.whl
 | 
			
		||||
%endif
 | 
			
		||||
 | 
			
		||||
%if %{with test}
 | 
			
		||||
%check
 | 
			
		||||
export PYTHONPATH=$(pwd)/build/lib
 | 
			
		||||
@@ -126,6 +142,7 @@ donttest+=" or test_from_link_vcs_without_source_dir"
 | 
			
		||||
[ -h %{_bindir}/pip ] || rm -f %{_bindir}/pip
 | 
			
		||||
[ -h %{_bindir}/pip3 ] || rm -f %{_bindir}/pip3
 | 
			
		||||
 | 
			
		||||
%if !%{with test} && !%{with wheel}
 | 
			
		||||
%post
 | 
			
		||||
# keep the alternative groups separate. Users could decide to let pip and pip3 point to
 | 
			
		||||
# different flavors
 | 
			
		||||
@@ -137,9 +154,10 @@ donttest+=" or test_from_link_vcs_without_source_dir"
 | 
			
		||||
%postun
 | 
			
		||||
%python_uninstall_alternative pip
 | 
			
		||||
%python_uninstall_alternative pip3
 | 
			
		||||
%endif
 | 
			
		||||
 | 
			
		||||
%if ! %{with test}
 | 
			
		||||
%files %{python_files}
 | 
			
		||||
%if !%{with test} && !%{with wheel}
 | 
			
		||||
%license LICENSE.txt
 | 
			
		||||
%doc AUTHORS.txt NEWS.rst README.rst
 | 
			
		||||
%python_alternative %{_bindir}/pip
 | 
			
		||||
@@ -153,4 +171,9 @@ donttest+=" or test_from_link_vcs_without_source_dir"
 | 
			
		||||
%{python_sitelib}/pip
 | 
			
		||||
%endif
 | 
			
		||||
 | 
			
		||||
%if %{with wheel}
 | 
			
		||||
%dir %{python_sitelib}/../wheels
 | 
			
		||||
%{python_sitelib}/../wheels/*
 | 
			
		||||
%endif
 | 
			
		||||
 | 
			
		||||
%changelog
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +0,0 @@
 | 
			
		||||
version https://git-lfs.github.com/spec/v1
 | 
			
		||||
oid sha256:68e7fd3508687f94367f1aa090a3ed921cd045a60b73d8b0aa1f305199a0ca28
 | 
			
		||||
size 583923
 | 
			
		||||
		Reference in New Issue
	
	Block a user