From 9bf035f421d5228574562c1d5a31e62e79cdec90 Mon Sep 17 00:00:00 2001 From: Shuo Wang Date: Thu, 4 Jan 2024 11:15:54 +0800 Subject: [PATCH] test abi Signed-off-by: Shuo Wang --- 62.3.2-skip-unsopported-test-cases.patch | 29 --- Remove-optional-or-unpackaged-test-deps.patch | 27 +-- ...x-eliminate-random-order-in-metadata.patch | 25 +++ python-setuptools.spec | 197 ++++++------------ sources | 2 +- 5 files changed, 108 insertions(+), 172 deletions(-) delete mode 100644 62.3.2-skip-unsopported-test-cases.patch create mode 100644 bugfix-eliminate-random-order-in-metadata.patch diff --git a/62.3.2-skip-unsopported-test-cases.patch b/62.3.2-skip-unsopported-test-cases.patch deleted file mode 100644 index 0b130ea..0000000 --- a/62.3.2-skip-unsopported-test-cases.patch +++ /dev/null @@ -1,29 +0,0 @@ -when we build setuptools on TencentOS, we found that it lacks some dependencies in OS and build environment. -In koji, there is not network environment, so pip is disabled. And some python module is missing in TencentOS: -msvc cannot support linux, so we avoid test setuptools/tests/test_msvc.py -TencentOS lacks python3-build now, so we comment setuptools/tests/test_config_discovery.py and setuptools/tests/integration/* -setuptools/tests/test_develop.py has bug in TencentOS -TencentOS lacks python3-tomli-w now, so we comment setuptools/tests/config/test_apply_pyprojecttoml.py -TencentOS lacks some pytest plugins, so we comment setuptools/tests/test_config_discovery.py - -Thu May 26 2022 Zhao Zhen - 62.3.2-1 - ---- -diff --git a/pytest.ini b/pytest.ini -index 14c7e94c..8c5a3f8e 100644 ---- a/pytest.ini -+++ b/pytest.ini -@@ -4,6 +4,13 @@ addopts= - --doctest-modules - --doctest-glob=pkg_resources/api_tests.txt - -r sxX -+ --ignore=setuptools/tests/integration/* -+ --ignore=setuptools/tests/test_msvc.py -+ --ignore=setuptools/tests/config/test_pyprojecttoml.py -+ --ignore=setuptools/tests/config/test_apply_pyprojecttoml.py -+ --ignore=setuptools/tests/test_develop.py -+ --ignore=setuptools/tests/test_config_discovery.py -+ --ignore=setuptools/tests/test_easy_install.py - doctest_optionflags=ALLOW_UNICODE ELLIPSIS - filterwarnings= - # Fail on warnings diff --git a/Remove-optional-or-unpackaged-test-deps.patch b/Remove-optional-or-unpackaged-test-deps.patch index 247a193..7e74ae1 100644 --- a/Remove-optional-or-unpackaged-test-deps.patch +++ b/Remove-optional-or-unpackaged-test-deps.patch @@ -1,6 +1,6 @@ -From 87a18ba242ac7f02d41b877ffc796dde42e6a93e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= -Date: Wed, 10 Aug 2022 16:08:41 +0200 +From 850efbc4dfe5b8c64dd21617bc856ba0d4e3a082 Mon Sep 17 00:00:00 2001 +From: Lumir Balhar +Date: Wed, 20 Sep 2023 19:47:05 +0200 Subject: [PATCH] Remove optional or unpackaged test deps --- @@ -8,38 +8,41 @@ Subject: [PATCH] Remove optional or unpackaged test deps 1 file changed, 14 deletions(-) diff --git a/setup.cfg b/setup.cfg -index b4ee876..094f621 100644 +index c7aaf14..33b9cd7 100644 --- a/setup.cfg +++ b/setup.cfg -@@ -39,19 +39,7 @@ exclude = +@@ -42,17 +42,7 @@ exclude = [options.extras_require] testing = pytest >= 6 - pytest-checkdocs >= 2.4 -- pytest-flake8 -- flake8 < 5 - pytest-black >= 0.3.7; \ - python_implementation != "PyPy" - pytest-cov; \ - python_implementation != "PyPy" - pytest-mypy >= 0.9.1; \ - python_implementation != "PyPy" -- pytest-enabler >= 1.3 -- pytest-perf +- pytest-enabler >= 2.2 +- pytest-ruff; sys_platform != "cygwin" - flake8-2020 virtualenv>=13.0.0 wheel pip>=19.1 # For proper file:// URLs support. -@@ -59,8 +47,6 @@ testing = +@@ -60,13 +50,9 @@ testing = pytest-xdist jaraco.path>=3.2.0 build[virtualenv] - filelock>=3.4.0 -- pip_run>=8.8 ini2toml[lite]>=0.9 tomli-w>=1.0.0 pytest-timeout +- pytest-perf; \ +- sys_platform != "cygwin" +- jaraco.develop >= 7.21; python_version >= "3.9" and sys_platform != "cygwin" + testing-integration = + pytest + pytest-xdist -- -2.37.3 +2.41.0 diff --git a/bugfix-eliminate-random-order-in-metadata.patch b/bugfix-eliminate-random-order-in-metadata.patch new file mode 100644 index 0000000..f103434 --- /dev/null +++ b/bugfix-eliminate-random-order-in-metadata.patch @@ -0,0 +1,25 @@ +From 99ba862948c27f8851ae2131ff36daee0195ae4a Mon Sep 17 00:00:00 2001 +From: chengzihan2 +Date: Thu, 4 Jun 2020 17:29:07 +0800 +Subject: [PATCH] bugfix eliminate random order in metadata + +--- + setuptools/dist.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setuptools/dist.py b/setuptools/dist.py +index fb16886..86a5402 100644 +--- a/setuptools/dist.py ++++ b/setuptools/dist.py +@@ -208,7 +208,7 @@ def write_pkg_file(self, file): # noqa: C901 # is too complex (14) # FIXME + if self.long_description_content_type: + write_field('Description-Content-Type', self.long_description_content_type) + if self.provides_extras: +- for extra in self.provides_extras: ++ for extra in sorted(self.provides_extras): + write_field('Provides-Extra', extra) + + self._write_list(file, 'License-File', self.license_files or []) +-- +1.8.3.1 + diff --git a/python-setuptools.spec b/python-setuptools.spec index e6d4a0b..7189bf9 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -1,177 +1,114 @@ -%global srcname setuptools -%global python_wheel_name %{srcname}-%{version}-py3-none-any.whl - %bcond_with bootstrap %bcond_with tests -Summary: Easily download, build, install, upgrade, and uninstall Python packages -Name: python-setuptools -Version: 65.5.1 -Release: 2%{?dist} -License: MIT and (BSD or ASL 2.0) -URL: https://github.com/pypa/setuptools -Source0: %{pypi_source %{srcname} %{version}} +%global python3_record %{python3_sitelib}/setuptools-%{version}.dist-info/RECORD + +%global python_whldir %{_datadir}/python-wheels +%global python_whlname setuptools-%{version}-py3-none-any.whl + +Name: python-setuptools +Version: 68.0.0 +Release: 1 +Summary: Easily build and distribute Python packages -Patch3000: Remove-optional-or-unpackaged-test-deps.patch -# skip some test cases, please look at comments in patch file in detail -Patch5001: 62.3.2-skip-unsopported-test-cases.patch +License: MIT and (BSD or ASL 2.0) +URL: https://pypi.python.org/pypi/setuptools +Source0: %{pypi_source setuptools %{version}} -BuildRequires: python%{python3_pkgversion}-devel +Patch9000: bugfix-eliminate-random-order-in-metadata.patch +BuildArch: noarch + +BuildRequires: python3-devel %if %{with tests} -BuildRequires: gcc +BuildRequires: python3-pip, python3-mock +BuildRequires: python3-pytest, python3-pytest-fixture-config +BuildRequires: python3-pytest-virtualenv %endif - %if %{without bootstrap} -BuildRequires: pyproject-rpm-macros python%{python3_pkgversion}-setuptools python3-rpm-generators +BuildRequires: python3-pip, python3-wheel %endif -BuildArch: noarch +Provides: python-distribute = %{version}-%{release}, %{name}-wheel +Obsoletes: python-distribute < 0.6.36-2, %{name}-wheel %description -Setuptools is a fully-featured, actively-maintained, and stable library -designed to facilitate packaging Python projects. +Setuptools is a collection of enhancements to the Python distutils that allow +you to more easily build and distribute Python 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. - -# these bundles are generated by following command: -# cat pkg_resources/_vendor/vendored.txt setuptools/_vendor/vendored.txt > allvendor.txt -# %%{_rpmconfigdir}/pythonbundles.py allvendor.txt --namespace 'python3dist' -%global bundled %{expand: -Provides: bundled(python%{python3_pkgversion}dist(appdirs)) = 1.4.3 -Provides: bundled(python%{python3_pkgversion}dist(importlib-metadata)) = 4.11.1 -Provides: bundled(python%{python3_pkgversion}dist(importlib-resources)) = 5.4 -Provides: bundled(python%{python3_pkgversion}dist(jaraco-text)) = 3.7 -Provides: bundled(python%{python3_pkgversion}dist(more-itertools)) = 8.8 -Provides: bundled(python%{python3_pkgversion}dist(ordered-set)) = 3.1.1 -Provides: bundled(python%{python3_pkgversion}dist(packaging)) = 21.3 -Provides: bundled(python%{python3_pkgversion}dist(pyparsing)) = 3.0.9 -Provides: bundled(python%{python3_pkgversion}dist(typing-extensions)) = 4.0.1 -Provides: bundled(python%{python3_pkgversion}dist(zipp)) = 3.7 -Provides: bundled(python%{python3_pkgversion}dist(tomli)) = 2.0.1 -} - -%package -n python%{python3_pkgversion}-setuptools -Summary: Easily build and distribute Python 3 packages -%{bundled} - -%if %{with bootstrap} -Provides: python%{python3_pkgversion}dist(setuptools) = %{version} -Provides: python%{python3_version}dist(setuptools) = %{version} -%endif +This package contains a python wheel of setuptools to use with venv. + +%package -n python3-setuptools +Summary: Easily build and distribute Python 3 packages +Conflicts: python-setuptools < %{version}-%{release} +Provides: python%{python3_pkgversion}dist(setuptools) = %{version} +Provides: python%{python3_version}dist(setuptools) = %{version} -%description -n python%{python3_pkgversion}-setuptools +%description -n python3-setuptools Setuptools is a collection of enhancements to the Python 3 distutils that allow you to more easily build and distribute Python 3 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. - -%if %{without bootstrap} -%package -n %{python_wheel_pkg_prefix}-%{srcname}-wheel -Summary: The setuptools wheel -%{bundled} - -%description -n %{python_wheel_pkg_prefix}-%{srcname}-wheel -A Python wheel of setuptools to use with venv. -%endif +execute the software that requires pkg_resources.py. %prep -%autosetup -p1 -n %{srcname}-%{version} +%autosetup -n setuptools-%{version} -p1 find setuptools pkg_resources -name \*.py | xargs sed -i -e '1 {/^#!\//d}' rm -f setuptools/*.exe -rm -r docs/conf.py - -%if %{without bootstrap} -%generate_buildrequires -%pyproject_buildrequires -r %{?with_tests:-x testing} -%endif +rm setuptools/tests/test_integration.py +chmod -x README.rst %build -%if %{with bootstrap} -%py3_build +%if %{without bootstrap} +%py3_build_wheel %else -%pyproject_wheel +%py3_build %endif - %install -%if %{with bootstrap} -%py3_install -%else -%pyproject_install -%pyproject_save_files setuptools pkg_resources _distutils_hack -%endif - -rm -rf %{buildroot}%{python3_sitelib}/pkg_resources/tests/ %if %{without bootstrap} -sed -i '/\/pkg_resources\/tests\b/d' %{pyproject_files} +%py3_install_wheel %{python_whlname} +sed -i '/\/usr\/bin\/easy_install,/d' %{buildroot}%{python3_record} +rm -rf %{buildroot}%{python3_sitelib}/{setuptools, pkg_resources}/tests +sed -i '/^setuptools\/tests\//d' %{buildroot}%{python3_record} +find %{buildroot}%{python3_sitelib} -name '*.exe' | xargs rm -f -mkdir -p %{buildroot}%{python_wheel_dir} -install -p %{_pyproject_wheeldir}/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir} +rm -r docs/conf.py +mkdir -p %{buildroot}%{python_whldir} +install -p dist/%{python_whlname} -t %{buildroot}%{python_whldir} +%else +%py3_install %endif - %if %{with tests} %check -cat pkg_resources/_vendor/vendored.txt setuptools/_vendor/vendored.txt > allvendor.txt -%{_rpmconfigdir}/pythonbundles.py allvendor.txt --namespace 'python%{python3_pkgversion}dist' --compare-with '%{bundled}' - -test $(stat --format %%s %{_pyproject_wheeldir}/%{python_wheel_name}) -lt 900000 -test ! -d %{buildroot}%{python3_sitelib}/pkg_resources/tests -test ! -d %{buildroot}%{python3_sitelib}/setuptools/tests - -rm pyproject.toml - -PRE_BUILT_SETUPTOOLS_WHEEL=%{_pyproject_wheeldir}/%{python_wheel_name} \ -PYTHONPATH=$(pwd) %pytest \ - --ignore=setuptools/tests/test_integration.py \ - --ignore=setuptools/tests/integration/ \ - --ignore=setuptools/tests/test_editable_install.py \ - --ignore=setuptools/tests/config/test_apply_pyprojecttoml.py \ - -k "not test_pip_upgrade_from_source" -%endif # with tests - -%files -n python%{python3_pkgversion}-setuptools %{?!with_bootstrap:-f %{pyproject_files}} -%license LICENSE -%doc docs/* CHANGES.rst README.rst -%{python3_sitelib}/distutils-precedence.pth -%if %{with bootstrap} -%{python3_sitelib}/setuptools-%{version}-py%{python3_version}.egg-info/ -%{python3_sitelib}/pkg_resources/ -%{python3_sitelib}/setuptools/ -%{python3_sitelib}/_distutils_hack/ +PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=$(pwd) py.test-%{python3_version} --ignore=setuptools/tests/test_virtualenv.py --ignore=pavement.py %endif -%if %{without bootstrap} -%files -n %{python_wheel_pkg_prefix}-%{srcname}-wheel +%files +%defattr(-,root,root) %license LICENSE -%dir %{python_wheel_dir}/ -%{python_wheel_dir}/%{python_wheel_name} +%if %{without bootstrap} +%dir %{python_whldir}/ +%{python_whldir}/%{python_whlname} %endif -%changelog -* Tue Sep 19 2023 Shuo Wang - 65.5.1-2 -- Rebuilt for python 3.11 - -* Tue Sep 19 2023 Shuo Wang - 65.5.1-1 -- update to 65.5.1 - -* Tue Sep 19 2023 OpenCloudOS Release Engineering - 62.3.2-5 -- Rebuilt for python 3.11 +%files -n python3-setuptools +%defattr(-,root,root) +%{python3_sitelib}/pkg_resources/ +%{python3_sitelib}/setuptools*/ +%{python3_sitelib}/distutils-precedence.pth +%{python3_sitelib}/_distutils_hack/ -* Fri Sep 08 2023 OpenCloudOS Release Engineering - 62.3.2-4 -- Rebuilt for OpenCloudOS Stream 23.09 +%defattr(-,root,root) +%doc docs/* CHANGES.rst README.rst -* Fri Apr 28 2023 OpenCloudOS Release Engineering - 62.3.2-3 -- Rebuilt for OpenCloudOS Stream 23.05 -* Fri Mar 31 2023 OpenCloudOS Release Engineering - 62.3.2-2 -- Rebuilt for OpenCloudOS Stream 23 +%changelog +* Wed Jul 12 2023 Shuo Wang - 68.0.0-1 +- Update package to version 68.0.0 -* Thu May 26 2022 Zhao Zhen - 62.3.2-1 -- Initial building. diff --git a/sources b/sources index 609cf24..b1808ac 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (setuptools-65.5.1.tar.gz) = e75eb7fdb0bc5ffdc76ed864cf753c2672d097a60f8747ac5cd40a49276d33df31fb619877234b4c22693b627d9978ecdd48a5c6c48aa0bbb856d48dec70fb0a +SHA512 (setuptools-68.0.0.tar.gz) = da6d535a0db6eaf477c8c2148efbc2100fd88a14f3adad44d20e22bf52bee3f00fe86547ea650fe653519bd6ff5f9ef033a55bb3a05fed041e88e78cdfb81d7e -- Gitee