From 0cd64b519100c1d11e7416462fbfad83f762b13fb714a9ba1bcc01a5bcfee9b4 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 2 Jan 2024 17:38:05 +0000 Subject: [PATCH 1/2] Accepting request 1134666 from home:bnavigator:branches:devel:languages:python - Drop fix-get-python-lib-python38.patch: No Python <3.9 built - Drop ugly allow-only-direct-compilation.patch in favor of proper PEP517 compliant bootstrap, using a built-in pip and the wheel package OBS-URL: https://build.opensuse.org/request/show/1134666 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=259 --- _multibuild | 1 - allow-only-direct-compilation.patch | 33 -------------- fix-get-python-lib-python38.patch | 21 --------- python-setuptools.changes | 8 ++++ python-setuptools.spec | 68 ++++++++++++++--------------- 5 files changed, 41 insertions(+), 90 deletions(-) delete mode 100644 allow-only-direct-compilation.patch delete mode 100644 fix-get-python-lib-python38.patch diff --git a/_multibuild b/_multibuild index 6222fa7..fcc7b97 100644 --- a/_multibuild +++ b/_multibuild @@ -1,4 +1,3 @@ test - wheel diff --git a/allow-only-direct-compilation.patch b/allow-only-direct-compilation.patch deleted file mode 100644 index 39b5abc..0000000 --- a/allow-only-direct-compilation.patch +++ /dev/null @@ -1,33 +0,0 @@ -Index: setuptools-69.0.2/setuptools/_distutils/command/install_lib.py -=================================================================== ---- setuptools-69.0.2.orig/setuptools/_distutils/command/install_lib.py -+++ setuptools-69.0.2/setuptools/_distutils/command/install_lib.py -@@ -133,6 +133,12 @@ class install_lib(Command): - # should at least generate usable bytecode in RPM distributions. - install_root = self.get_finalized_command('install').root - -+ # UGLY HACK WARNING. Indirect compilation requires distutils, which -+ # means Python 3.11 or less. If and only if an environment variable -+ # is set, do we force direct compilation. -+ # See also https://github.com/pypa/setuptools/issues/4164 -+ direct = os.environ.get('SETUPTOOLS_FORCE_DIRECT', None) -+ - if self.compile: - byte_compile( - files, -@@ -140,6 +146,7 @@ class install_lib(Command): - force=self.force, - prefix=install_root, - dry_run=self.dry_run, -+ direct=direct, - ) - if self.optimize > 0: - byte_compile( -@@ -149,6 +156,7 @@ class install_lib(Command): - prefix=install_root, - verbose=self.verbose, - dry_run=self.dry_run, -+ direct=direct, - ) - - # -- Utility methods ----------------------------------------------- diff --git a/fix-get-python-lib-python38.patch b/fix-get-python-lib-python38.patch deleted file mode 100644 index ed8888f..0000000 --- a/fix-get-python-lib-python38.patch +++ /dev/null @@ -1,21 +0,0 @@ -Index: setuptools-68.0.0/setuptools/_distutils/sysconfig.py -=================================================================== ---- setuptools-68.0.0.orig/setuptools/_distutils/sysconfig.py -+++ setuptools-68.0.0/setuptools/_distutils/sysconfig.py -@@ -246,9 +246,13 @@ def get_python_lib(plat_specific=0, stan - - if os.name == "posix": - if plat_specific or standard_lib: -- # Platform-specific modules (any module from a non-pure-Python -- # module distribution) or standard Python library modules. -- libdir = getattr(sys, "platlibdir", "lib") -+ # Python 3.8 doesn't have sys.platlibdir -+ if sys.version_info < (3, 9): -+ libdir = get_config_var("platsubdir") or "lib" -+ else: -+ # Platform-specific modules (any module from a non-pure-Python -+ # module distribution) or standard Python library modules. -+ libdir = getattr(sys, "platlibdir", "lib") - else: - # Pure Python - libdir = "lib" diff --git a/python-setuptools.changes b/python-setuptools.changes index a55899a..100d93f 100644 --- a/python-setuptools.changes +++ b/python-setuptools.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Dec 22 14:58:46 UTC 2023 - Ben Greiner + +- Drop fix-get-python-lib-python38.patch: No Python <3.9 built +- Drop ugly allow-only-direct-compilation.patch in favor of proper + PEP517 compliant bootstrap, using a built-in pip and the wheel + package + ------------------------------------------------------------------- Fri Dec 22 04:10:44 UTC 2023 - Steve Kowalik diff --git a/python-setuptools.spec b/python-setuptools.spec index e2fdf0f..f51c458 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -21,17 +21,10 @@ %if "%{flavor}" == "test" %define psuffix -test %bcond_without test -%bcond_with wheel -%endif -%if "%{flavor}" == "wheel" -%define psuffix -wheel -%bcond_with test -%bcond_without wheel %endif %if "%{flavor}" == "" %define psuffix %{nil} %bcond_with test -%bcond_with wheel %endif # in order to avoid rewriting for subpackage generator @@ -45,19 +38,15 @@ License: Apache-2.0 AND MIT AND BSD-2-Clause AND Python-2.0 URL: https://github.com/pypa/setuptools Source: https://files.pythonhosted.org/packages/source/s/setuptools/setuptools-%{version}.tar.gz Patch0: sort-for-reproducibility.patch -# PATCH-FIX-OPENSUSE fix-get-python-lib-python38.patch bsc#1204395 -Patch2: fix-get-python-lib-python38.patch -# PATCH-FIX-OPENSUSE Allow forcing direct compilation, see gh#pypa/setuptools#4164 -Patch3: allow-only-direct-compilation.patch -BuildRequires: %{python_module base >= 3.7} +# Bootstrap: Don't BuildRequire pip here! +BuildRequires: %{python_module base >= 3.9} +# The rpm python-wheel build is bootstrap friendly since 0.42 +BuildRequires: %{python_module wheel >= 0.42} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires(post): update-alternatives Requires(postun):update-alternatives BuildArch: noarch -%if %{with wheel} -Requires: %mypython(abi) = %python_version -%endif %if %{with test} BuildRequires: %{python_module build} BuildRequires: %{python_module devel} @@ -75,14 +64,10 @@ BuildRequires: %{python_module setuptools = %{version}} BuildRequires: %{python_module setuptools-wheel = %{version}} BuildRequires: %{python_module tomli-w >= 1.0.0} BuildRequires: %{python_module virtualenv >= 13.0.0} -BuildRequires: %{python_module wheel} %endif %if 0%{?suse_version} || 0%{?fedora_version} >= 24 Recommends: ca-certificates-mozilla %endif -%if %{with wheel} -BuildRequires: %{python_module wheel} -%endif %python_subpackages %description @@ -90,6 +75,14 @@ setuptools is a collection of enhancements to the Python distutils that allow you to build and distribute Python packages, especially ones that have dependencies on other packages. +%package wheel +Summary: The setuptools wheel for custom tests and install requirements +Requires: %mypython(abi) = %python_version + +%description wheel +This packages provides the setuptools wheel as separate file for cases where +the wheel needs to be used directly in test or install setups + %prep %autosetup -p1 -n setuptools-%{version} @@ -97,26 +90,32 @@ especially ones that have dependencies on other packages. rm -f setuptools/*.exe %build -%if ! %{with wheel} -%python_build -%else -%python_exec setup.py bdist_wheel --universal +%if !%{with test} +%{python_expand # bootstrap with built-in pip +$python -m venv build/env +build/env/bin/python -m ensurepip +export PYTHONPATH=build/env/lib/python%{$python_bin_suffix}/site-packages +%{$python_pyproject_wheel} +} %endif %install -%if !%{with test} && !%{with wheel} -export SETUPTOOLS_FORCE_DIRECT=True -%python_install -%python_expand %fdupes %{buildroot}%{$python_sitelib} -%endif - -%if %{with wheel} -%python_expand install -D -m 0644 -t %{buildroot}%{$python_sitelib}/../wheels dist/*.whl +%if !%{with test} +%{python_expand # use pip bootstrapped above +export PYTHONPATH=build/env/lib/python%{$python_bin_suffix}/site-packages +%{$python_pyproject_install} +%fdupes %{buildroot}%{$python_sitelib} +install -D -m 0644 -t %{buildroot}%{$python_sitelib}/../wheels dist/*.whl +} %endif %check %if %{with test} -%python_expand export PRE_BUILT_SETUPTOOLS_WHEEL=%{$python_sitelib}/../wheels/setuptools-%{version}-py2.py3-none-any.whl +%{python_expand # just use the last one from the expansion, they're all the same +mkdir -p dist/ +cp %{$python_sitelib}/../wheels/setuptools-%{version}-py3-none-any.whl $PWD/dist/ +} +export PRE_BUILT_SETUPTOOLS_WHEEL=$PWD/dist/setuptools-%{version}-py3-none-any.whl export LANG=en_US.UTF-8 # tests need imports from local source dir export PYTHONPATH=$(pwd) @@ -133,17 +132,16 @@ donttest+=" or test_pbr_integration" %license LICENSE %doc NEWS.rst README.rst %{python_sitelib}/setuptools -%{python_sitelib}/setuptools-%{version}*-info +%{python_sitelib}/setuptools-%{version}.dist-info %dir %{python_sitelib}/pkg_resources %{python_sitelib}/pkg_resources/* %{python_sitelib}/_distutils_hack %{python_sitelib}/distutils-precedence.pth %endif -%if %{with wheel} +%files %{python_files wheel} %dir %{python_sitelib}/../wheels %{python_sitelib}/../wheels/* %endif -%endif %changelog From 2c5fb51ada25375c2f240f35d14df0d413f84af9193a974bb40674c487832e92 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 2 Jan 2024 21:56:22 +0000 Subject: [PATCH 2/2] - update to 69.0.3: * Bugfixes - Retain valid names with underscores in egg_info. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=260 --- python-setuptools.changes | 6 ++++++ python-setuptools.spec | 4 ++-- setuptools-69.0.2.tar.gz | 3 --- setuptools-69.0.3.tar.gz | 3 +++ 4 files changed, 11 insertions(+), 5 deletions(-) delete mode 100644 setuptools-69.0.2.tar.gz create mode 100644 setuptools-69.0.3.tar.gz diff --git a/python-setuptools.changes b/python-setuptools.changes index 100d93f..e752368 100644 --- a/python-setuptools.changes +++ b/python-setuptools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jan 2 21:55:38 UTC 2024 - Dirk Müller + +- update to 69.0.3: + * Bugfixes - Retain valid names with underscores in egg_info. + ------------------------------------------------------------------- Fri Dec 22 14:58:46 UTC 2023 - Ben Greiner diff --git a/python-setuptools.spec b/python-setuptools.spec index f51c458..c167515 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -31,7 +31,7 @@ %define mypython python %{?sle15_python_module_pythons} Name: python-setuptools%{psuffix} -Version: 69.0.2 +Version: 69.0.3 Release: 0 Summary: Download, build, install, upgrade, and uninstall Python packages License: Apache-2.0 AND MIT AND BSD-2-Clause AND Python-2.0 diff --git a/setuptools-69.0.2.tar.gz b/setuptools-69.0.2.tar.gz deleted file mode 100644 index 0842f6e..0000000 --- a/setuptools-69.0.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:735896e78a4742605974de002ac60562d286fa8051a7e2299445e8e8fbb01aa6 -size 2219248 diff --git a/setuptools-69.0.3.tar.gz b/setuptools-69.0.3.tar.gz new file mode 100644 index 0000000..1abde1b --- /dev/null +++ b/setuptools-69.0.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be1af57fc409f93647f2e8e4573a142ed38724b8cdd389706a867bb4efcf1e78 +size 2219609