From f2b04ad93f42019e46cdad2334c98e5132ef316b Mon Sep 17 00:00:00 2001 From: huangtianhua Date: Wed, 9 Feb 2022 02:14:14 +0000 Subject: [PATCH] Remove python2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 因为OpenStack-Train_openEuler-22.03-LTS-Next分支从20.03-LTS-SP3拉取的, 而22.03-LTS不再支持python2, 该软件包spec中涉及python2打包相关都需要删除。 --- python-setuptools.spec | 49 ++++-------------------------------------- 1 file changed, 4 insertions(+), 45 deletions(-) diff --git a/python-setuptools.spec b/python-setuptools.spec index 8b30cdd..398525a 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -1,17 +1,12 @@ %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: 44.1.1 -Release: 1 +Release: 2 Summary: Easily build and distribute Python packages License: MIT and (BSD or ASL 2.0) @@ -21,15 +16,6 @@ Patch0: create-site-packages.patch Patch9000: bugfix-eliminate-random-order-in-metadata.patch BuildArch: noarch -%if %{with python2} -BuildRequires: python2-devel -BuildRequires: python2-pip, python2-wheel -%if %{with tests} -BuildRequires: python2-pip, python2-mock, python2-backports-unittest_mock -BuildRequires: python2-pytest, python2-pytest-fixture-config -BuildRequires: python2-pytest-virtualenv -%endif -%endif BuildRequires: python3-devel %if %{with tests} @@ -49,20 +35,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 @@ -97,12 +69,6 @@ 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} @@ -110,9 +76,6 @@ 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,13 +85,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) @@ -144,6 +100,9 @@ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=$(pwd) py.test-%{python3_version} --ignore= %changelog +* Wed Feb 09 2022 huangtianhua - 44.1.1-2 +- Remove python2 + * Mon Aug 31 2020 shixuantong - 44.1.1-1 - update version 44.1.1 -- Gitee