From ab1adad271d07d6bd8de46ad6d3340e67bcf7333 Mon Sep 17 00:00:00 2001 From: Kaleb S. KEITHLEY Date: Oct 06 2021 15:26:15 +0000 Subject: first build for c9s --- diff --git a/.python-setuptools.metadata b/.python-setuptools.metadata index befc16c..835e819 100644 --- a/.python-setuptools.metadata +++ b/.python-setuptools.metadata @@ -1 +1 @@ -83e75ec6b04423735e0a9a384b465c68f5206bcf SOURCES/setuptools-39.2.0.zip +31c14da6f9ac813fa712532fbc1e64c1562a2833 SOURCES/setuptools-57.4.0.tar.gz diff --git a/SOURCES/create-site-packages.patch b/SOURCES/create-site-packages.patch deleted file mode 100644 index 60f9795..0000000 --- a/SOURCES/create-site-packages.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py -index 91c48b3..0c9b0f4 100755 ---- a/setuptools/command/easy_install.py -+++ b/setuptools/command/easy_install.py -@@ -446,6 +446,12 @@ class easy_install(Command): - instdir = normalize_path(self.install_dir) - pth_file = os.path.join(instdir, 'easy-install.pth') - -+ if not os.path.exists(instdir): -+ try: -+ os.makedirs(instdir) -+ except (OSError, IOError): -+ self.cant_write_to_target() -+ - # Is it a configured, PYTHONPATH, implicit, or explicit site dir? - is_site_dir = instdir in self.all_site_dirs - diff --git a/SPECS/python-setuptools.spec b/SPECS/python-setuptools.spec index d5eb135..d5dfdff 100644 --- a/SPECS/python-setuptools.spec +++ b/SPECS/python-setuptools.spec @@ -1,27 +1,37 @@ %global srcname setuptools +# The original RHEL 9 content set is defined by (build)dependencies +# of the packages in Fedora ELN. Hence we disable tests here +# to prevent pulling many unwanted packages in. +# Once the RHEL 9 content set is defined and/or RHEL 9 forks from ELN, +# the conditional can be removed from the Fedora spec file. +# We intentionally keep this enabled on EPEL. +%if 0%{?rhel} >= 9 && !0%{?epel} +%bcond_with tests +%else +%bcond_without tests +%endif + # WARNING When bootstrapping, disable tests as well, # because tests need pip. %bcond_with bootstrap -%bcond_with tests # Similar to what we have in pythonX.Y.spec files. # If enabled, provides unversioned executables and other stuff. # Disable it if you build this package in an alternative stack. %bcond_without main_python -%if %{without bootstrap} %global python_wheelname %{srcname}-%{version}-py3-none-any.whl -%global python3_record %{python3_sitelib}/%{srcname}-%{version}.dist-info/RECORD -%endif %global python_wheeldir %{_datadir}/python-wheels Name: python-setuptools # When updating, update the bundled libraries versions bellow! -Version: 50.3.2 +Version: 57.4.0 Release: 1%{?dist} Summary: Easily build and distribute Python packages # setuptools is MIT # appdirs is MIT +# more-itertools is MIT +# ordered-set is MIT # packaging is BSD or ASL 2.0 # pyparsing is MIT # the setuptools logo has unknown license and possible TM problems, @@ -29,29 +39,25 @@ Summary: Easily build and distribute Python packages # see https://github.com/pypa/setuptools/issues/2227 License: MIT and (BSD or ASL 2.0) URL: https://pypi.python.org/pypi/%{srcname} -Source0: %{pypi_source %{srcname} %{version} zip} +Source0: %{pypi_source %{srcname} %{version}} BuildArch: noarch -BuildRequires: gcc - BuildRequires: python%{python3_pkgversion}-devel + %if %{with tests} -BuildRequires: python%{python3_pkgversion}-pip -BuildRequires: python%{python3_pkgversion}-pytest -BuildRequires: python%{python3_pkgversion}-mock -BuildRequires: python%{python3_pkgversion}-pytest-fixture-config -BuildRequires: python%{python3_pkgversion}-pytest-virtualenv -BuildRequires: python%{python3_pkgversion}-jaraco-envs -%endif # with tests +BuildRequires: gcc +%endif + %if %{without bootstrap} -BuildRequires: python%{python3_pkgversion}-pip -BuildRequires: python%{python3_pkgversion}-wheel +BuildRequires: pyproject-rpm-macros >= 0-44 +# Not to use the pre-generated egg-info, we use setuptools from previous build to generate it +BuildRequires: python%{python3_pkgversion}-setuptools # python3 bootstrap: this is built before the final build of python3, which # adds the dependency on python3-rpm-generators, so we require it manually # The minimal version is for bundled provides verification script -BuildRequires: python3-rpm-generators -%endif # without bootstrap +BuildRequires: python3-rpm-generators >= 11-8 +%endif %description Setuptools is a collection of enhancements to the Python distutils that allow @@ -62,10 +68,15 @@ This package also contains the runtime components of setuptools, necessary to execute the software that requires pkg_resources. # Virtual provides for the packages bundled by setuptools. -# You can generate it with: -# %%{_rpmconfigdir}/pythonbundles.py --namespace 'python%%{python3_pkgversion}dist' pkg_resources/_vendor/vendored.txt +# Bundled packages are defined in two files: +# - pkg_resources/_vendor/vendored.txt, and +# - setuptools/_vendor/vendored.txt +# Merge them to one and then generate the list with: +# %%{_rpmconfigdir}/pythonbundles.py --namespace 'python%%{python3_pkgversion}dist' allvendor.txt %global bundled %{expand: Provides: bundled(python%{python3_pkgversion}dist(appdirs)) = 1.4.3 +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)) = 20.4 Provides: bundled(python%{python3_pkgversion}dist(pyparsing)) = 2.2.1 } @@ -75,12 +86,9 @@ Summary: Easily build and distribute Python 3 packages %{bundled} %if %{with bootstrap} -Provides: python3dist(setuptools) = %{version} +Provides: python%{python3_pkgversion}dist(setuptools) = %{version} Provides: python%{python3_version}dist(setuptools) = %{version} %endif -Obsoletes: platform-python-setuptools < %{version} -Provides: platform-python-setuptools = %{version}-%{release} - %description -n python%{python3_pkgversion}-setuptools Setuptools is a collection of enhancements to the Python 3 distutils that allow @@ -102,84 +110,97 @@ A Python wheel of setuptools to use with venv. %prep %autosetup -p1 -n %{srcname}-%{version} +%if %{without bootstrap} +# If we don't have setuptools installed yet, we use the pre-generated .egg-info +# See https://github.com/pypa/setuptools/pull/2543 +# And https://github.com/pypa/setuptools/issues/2550 rm -r %{srcname}.egg-info +%endif # Strip shbang find setuptools pkg_resources -name \*.py | xargs sed -i -e '1 {/^#!\//d}' # Remove bundled exes rm -f setuptools/*.exe -# These tests require internet connection -rm setuptools/tests/test_integration.py -# We don't do linting or coverage here +# Don't ship these +rm -r docs/conf.py + +# The following test deps are optional and either not desired or not available in Fedora: +# (note that we intentionally also remove e.g. flake8-something or something-flake8 here) +sed -Ei setup.cfg -e '/\bpytest-(checkdocs|black|cov|mypy|enabler)\b/d' \ + -e '/\bflake8\b/d' \ + -e '/\bpaver\b/d' +# Strip pytest options that require the packages removed by the previous sed sed -i pytest.ini -e 's/ --flake8//' \ -e 's/ --cov//' -%build -# Warning, different bootstrap meaning here, has nothing to do with our bcond -# This bootstraps .egg-info directory needed to build setuptools -%{__python3} bootstrap.py - %if %{without bootstrap} -%py3_build_wheel -%else +%generate_buildrequires +%pyproject_buildrequires -r %{?with_tests:-x testing} +%endif +%build +%if %{with bootstrap} %py3_build +%else +%pyproject_wheel %endif %install -%if %{without bootstrap} -%py3_install_wheel %{python_wheelname} -%else +%if %{with bootstrap} %py3_install +%else +%pyproject_install +%pyproject_save_files setuptools pkg_resources _distutils_hack %endif -# This is not installed (in 45.2.0 anyway), but better be safe than sorry -rm -rf %{buildroot}%{python3_sitelib}/{setuptools,pkg_resources}/tests - +# https://github.com/pypa/setuptools/issues/2709 +rm -rf %{buildroot}%{python3_sitelib}/pkg_resources/tests/ %if %{without bootstrap} -sed -i '/^setuptools\/tests\//d' %{buildroot}%{python3_record} -%endif - -find %{buildroot}%{python3_sitelib} -name '*.exe' | xargs rm -f - -# Don't ship these -rm -r docs/{conf.py,_*} +sed -i '/\/pkg_resources\/tests\b/d' %{pyproject_files} -%if %{without bootstrap} +# Install the wheel for the python-setuptools-wheel package mkdir -p %{buildroot}%{python_wheeldir} -install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} +install -p %{_pyproject_wheeldir}/%{python_wheelname} -t %{buildroot}%{python_wheeldir} %endif -%if %{without main_python} -rm %{buildroot}%{_bindir}/easy_install -%endif %if %{with tests} %check # Verify bundled provides are up to date -%{_rpmconfigdir}/pythonbundles.py pkg_resources/_vendor/vendored.txt --compare-with '%{bundled}' +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}' + +# Regression test, the wheel should not be larger than 600 KiB +# https://bugzilla.redhat.com/show_bug.cgi?id=1914481#c3 +test $(du %{_pyproject_wheeldir}/%{python_wheelname} | cut -f1) -lt 600 + +# Regression test, the tests are not supposed to be installed +test ! -d %{buildroot}%{python3_sitelib}/pkg_resources/tests +test ! -d %{buildroot}%{python3_sitelib}/setuptools/tests + +# https://github.com/pypa/setuptools/discussions/2607 +rm pyproject.toml # Upstream tests +# --ignore=setuptools/tests/test_integration.py +# the tests require internet connection # --ignore=pavement.py: # pavement.py is only used by upstream to do releases and vendoring, we don't ship it -PYTHONPATH=$(pwd) %pytest --ignore=pavement.py +PYTHONPATH=$(pwd) %pytest --ignore=setuptools/tests/test_integration.py --ignore=pavement.py %endif # with tests -%files -n python%{python3_pkgversion}-setuptools +%files -n python%{python3_pkgversion}-setuptools %{?!with_bootstrap:-f %{pyproject_files}} %license LICENSE %doc docs/* CHANGES.rst README.rst -%{python3_sitelib}/easy_install.py +%{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}/setuptools/ %{python3_sitelib}/_distutils_hack/ -%{python3_sitelib}/distutils-precedence.pth -%{python3_sitelib}/__pycache__/* -%if %{with main_python} -%{_bindir}/easy_install %endif -%{_bindir}/easy_install-3.* %if %{without bootstrap} %files wheel @@ -191,11 +212,76 @@ PYTHONPATH=$(pwd) %pytest --ignore=pavement.py %changelog -* Thu Nov 05 2020 Joel Capitao - 50.3.2-1 -- Update to 50.3.2 +* Tue Aug 03 2021 Miro Hrončok - 57.4.0-1 +- Update to 57.4.0 +- https://setuptools.readthedocs.io/en/latest/history.html#v57-4-0 +- Fixes rhbz#1982493 + +* Fri Jul 23 2021 Fedora Release Engineering - 57.1.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Mon Jul 19 2021 Miro Hrončok - 57.1.0-2 +- Modernize packaging + +* Fri Jul 09 2021 Tomas Hrnciar - 57.1.0-1 +- Update to 57.1.0 +- Fixes rhbz#1979122 -* Thu Oct 29 2020 Joel Capitao - 50.3.0-1 -- Update to 50.3.0 +* Thu Jun 17 2021 Lumír Balhar - 57.0.0-1 +- Update to 57.0.0 +Resolves: rhbz#1963411 + +* Fri Jun 04 2021 Python Maint - 56.2.0-4 +- Rebuilt for Python 3.10 + +* Tue Jun 01 2021 Python Maint - 56.2.0-3 +- Bootstrap for Python 3.10 + +* Tue Jun 01 2021 Python Maint - 56.2.0-2 +- Bootstrap for Python 3.10 + +* Mon May 17 2021 Miro Hrončok - 56.2.0-1 +- Update to 56.2.0 +- Fixes rhbz#1958677 + +* Thu May 06 2021 Tomas Hrnciar - 56.1.0-1 +- Update to 56.1.0 + +* Thu Apr 22 2021 Miro Hrončok - 56.0.0-2 +- Provide python3-pkg_resources +- Provide python3-pkg-resources + +* Fri Apr 09 2021 Tomas Hrnciar - 56.0.0-1 +- Update to 56.0.0 + +* Tue Mar 16 2021 Tomas Hrnciar - 54.1.2-1 +- Update to 54.1.2 + +* Tue Feb 02 2021 Miro Hrončok - 53.0.0-1 +- Update to 53.0.0 +- https://setuptools.readthedocs.io/en/latest/history.html#v53-0-0 +- Fixes: rhbz#1923249 + +* Tue Jan 26 2021 Lumír Balhar - 52.0.0-1 +- Update to 52.0.0 (#1917060) +- Removes easy_install module and executable + +* Mon Jan 11 2021 Miro Hrončok - 51.1.2-1 +- Update to 51.1.2 +- Removes tests from the wheel +- https://setuptools.readthedocs.io/en/latest/history.html#v51-1-2 +- Fixes: rhbz#1914481 + +* Tue Dec 29 2020 Miro Hrončok - 51.1.1-1 +- Update to 51.1.1 +- Fixes test failures with pip 20.3 as well as with pytest 6.2+ +- Fixes: rhbz#1909575 + +* Fri Dec 4 2020 Miro Hrončok - 50.3.2-2 +- Disable tests in Fedora ELN (and RHEL) + +* Tue Oct 20 2020 Tomas Hrnciar - 50.3.2-1 +- Update to 50.3.2 (#1889093) * Fri Sep 04 2020 Tomas Hrnciar - 50.1.0-1 - Update to 50.1.0 (#1873889) @@ -869,7 +955,7 @@ PYTHONPATH=$(pwd) %pytest --ignore=pavement.py * Thu Feb 04 2010 Toshio Kuratomi - 0.6.10-3 - First build with python3 support enabled. - + * Fri Jan 29 2010 Toshio Kuratomi - 0.6.10-2 - Really disable the python3 portion