remove python2

Merge pull request !9 from 桐小哥/master
This commit is contained in:
openeuler-ci-bot 2020-09-02 14:10:44 +08:00 committed by wangjie
commit de1f6d95f9
2 changed files with 11 additions and 48 deletions

View File

@ -1,17 +1,13 @@
%bcond_with tests
%bcond_without python2
%if %{with python2}
%global python2_record %{python2_sitelib}/setuptools-%{version}.dist-info/RECORD
%endif
%global python3_record %{python3_sitelib}/setuptools-%{version}.dist-info/RECORD
%global python_whldir %{_datadir}/python-wheels
%global python_whlname setuptools-%{version}-py2.py3-none-any.whl
Name: python-setuptools
Version: 41.5.0
Release: 1
Version: 44.1.1
Release: 2
Summary: Easily build and distribute Python packages
License: MIT and (BSD or ASL 2.0)
@ -21,15 +17,6 @@ Patch0: create-site-packages.patch
Patch9000: bugfix-eliminate-random-order-in-metadata.patch
BuildArch: noarch
%if %{with python2}
BuildRequires: python2-devel python2
BuildRequires: python2-pip, python2-wheel
%if %{with tests}
BuildRequires: python2-pip
BuildRequires: python2-pytest, python2-pytest-fixture-config
BuildRequires: python2-pytest-virtualenv
%endif
%endif
BuildRequires: python3-devel
%if %{with tests}
@ -49,21 +36,6 @@ have dependencies on other packages.
This package contains a python wheel of setuptools to use with venv.
%if %{with python2}
%package -n python2-setuptools
Summary: Easily build and distribute Python packages
%{?python_provide:%python_provide python2-setuptools}
%description -n python2-setuptools
Setuptools is a collection of enhancements to the Python 2 distutils that allow
you to more easily build and distribute Python 2 packages, especially ones that
have dependencies on other packages.
This package also contains the runtime components of setuptools, necessary to
execute the software that requires pkg_resources.py.
%endif
%package -n python3-setuptools
Summary: Easily build and distribute Python 3 packages
Conflicts: python-setuptools < %{version}-%{release}
@ -97,22 +69,12 @@ rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests
sed -i '/^setuptools\/tests\//d' %{buildroot}%{python3_record}
find %{buildroot}%{python3_sitelib} -name '*.exe' | xargs rm -f
%if %{with python2}
%py2_install_wheel %{python_whlname}
rm -rf %{buildroot}%{python2_sitelib}/setuptools/tests
sed -i '/^setuptools\/tests\//d' %{buildroot}%{python2_record}
find %{buildroot}%{python2_sitelib} -name '*.exe' | xargs rm -f
%endif
rm -r docs/{Makefile,conf.py,_*}
mkdir -p %{buildroot}%{python_whldir}
install -p dist/%{python_whlname} -t %{buildroot}%{python_whldir}
%if %{with tests}
%check
%if %{with python2}
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=$(pwd) py.test-%{python2_version}
%endif
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=$(pwd) py.test-%{python3_version} --ignore=setuptools/tests/test_virtualenv.py --ignore=pavement.py
%endif
@ -122,14 +84,6 @@ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=$(pwd) py.test-%{python3_version} --ignore=
%dir %{python_whldir}/
%{python_whldir}/%{python_whlname}
%if %{with python2}
%files -n python2-setuptools
%defattr(-,root,root)
%{_bindir}/easy_install
%{_bindir}/easy_install-2.*
%{python2_sitelib}/*
%endif
%files -n python3-setuptools
%defattr(-,root,root)
%{_bindir}/easy_install-3.*
@ -144,6 +98,15 @@ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=$(pwd) py.test-%{python3_version} --ignore=
%changelog
* Mon Nov 2 2020 wangjie<wangjie294@huawei.com> -44.1.1-2
- Type:NA
- ID:NA
- SUG:NA
- DESC:remove python2
* Wed Sep 2 2020 shixuantong<shixuantong@huawei.com> - 44.1.1 - 1
- update version to 44.1.1
* Tue Aug 25 2020 wenzhanli<wenzhanli2@huawei.com> - 41.5.0-1
- update version and add python2 require