Sync from SUSE:SLFO:Main python-setuptools revision 736f37e83b0379ff1580d7f81d2f3e83

This commit is contained in:
Adrian Schröter 2024-05-03 22:57:47 +02:00
commit eba857de12
8 changed files with 3210 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

4
_multibuild Normal file
View File

@ -0,0 +1,4 @@
<multibuild>
<package>test</package>
<package>wheel</package>
</multibuild>

View File

@ -0,0 +1,33 @@
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 -----------------------------------------------

View File

@ -0,0 +1,21 @@
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"

2917
python-setuptools.changes Normal file

File diff suppressed because it is too large Load Diff

149
python-setuptools.spec Normal file
View File

@ -0,0 +1,149 @@
#
# spec file
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define skip_python2 1
%global flavor @BUILD_FLAVOR@%{nil}
%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
%define mypython python
%{?sle15_python_module_pythons}
Name: python-setuptools%{psuffix}
Version: 69.0.2
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
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}
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}
BuildRequires: %{python_module filelock >= 3.4.0}
BuildRequires: %{python_module ini2toml-lite >= 0.9}
BuildRequires: %{python_module jaraco.develop >= 7.21}
BuildRequires: %{python_module jaraco.envs >= 2.2}
BuildRequires: %{python_module jaraco.path >= 3.2.0}
BuildRequires: %{python_module pip >= 19.1}
BuildRequires: %{python_module pip-run >= 8.8}
BuildRequires: %{python_module pytest >= 6}
BuildRequires: %{python_module pytest-timeout}
BuildRequires: %{python_module pytest-xdist}
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
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.
%prep
%autosetup -p1 -n setuptools-%{version}
# Remove bundled exes
rm -f setuptools/*.exe
%build
%if ! %{with wheel}
%python_build
%else
%python_exec setup.py bdist_wheel --universal
%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
%endif
%check
%if %{with test}
%python_expand export PRE_BUILT_SETUPTOOLS_WHEEL=%{$python_sitelib}/../wheels/setuptools-%{version}-py2.py3-none-any.whl
export LANG=en_US.UTF-8
# tests need imports from local source dir
export PYTHONPATH=$(pwd)
# no online comparisons in obs
donttest="(test_apply_pyproject_equivalent_to_setupcfg and https)"
# test_pbr_integration tries to install pbr from network using pip
donttest+=" or test_pbr_integration"
%pytest -rfE -n auto -k "not ($donttest)"
%endif
%if !%{with test}
%files %{python_files}
%if !%{with wheel}
%license LICENSE
%doc NEWS.rst README.rst
%{python_sitelib}/setuptools
%{python_sitelib}/setuptools-%{version}*-info
%dir %{python_sitelib}/pkg_resources
%{python_sitelib}/pkg_resources/*
%{python_sitelib}/_distutils_hack
%{python_sitelib}/distutils-precedence.pth
%endif
%if %{with wheel}
%dir %{python_sitelib}/../wheels
%{python_sitelib}/../wheels/*
%endif
%endif
%changelog

BIN
setuptools-69.0.2.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,60 @@
---
setuptools/command/easy_install.py | 2 +-
setuptools/command/egg_info.py | 2 +-
setuptools/dist.py | 2 +-
setuptools/tests/test_egg_info.py | 2 +-
setuptools/tests/test_wheel.py | 8 ++++----
5 files changed, 8 insertions(+), 8 deletions(-)
Index: setuptools-69.0.2/setuptools/command/easy_install.py
===================================================================
--- setuptools-69.0.2.orig/setuptools/command/easy_install.py
+++ setuptools-69.0.2/setuptools/command/easy_install.py
@@ -441,7 +441,7 @@ class easy_install(Command):
for spec in self.args:
self.easy_install(spec, not self.no_deps)
if self.record:
- outputs = self.outputs
+ outputs = list(sorted(self.outputs))
if self.root: # strip any package prefix
root_len = len(self.root)
for counter in range(len(outputs)):
Index: setuptools-69.0.2/setuptools/tests/test_wheel.py
===================================================================
--- setuptools-69.0.2.orig/setuptools/tests/test_wheel.py
+++ setuptools-69.0.2/setuptools/tests/test_wheel.py
@@ -424,30 +424,30 @@ WHEEL_INSTALL_TESTS = (
dict(
id='requires_ensure_order',
install_requires='''
- foo
bar
baz
+ foo
qux
''',
extras_require={
'extra': '''
- foobar>3
barbaz>4
bazqux>5
+ foobar>3
quxzap>6
''',
},
requires_txt=DALS(
'''
- foo
bar
baz
+ foo
qux
[extra]
- foobar>3
barbaz>4
bazqux>5
+ foobar>3
quxzap>6
'''
),