Compare commits

...

64 Commits

Author SHA1 Message Date
Python Maint
5f98fe006c Rebuilt for Python 3.12 2023-06-13 15:09:02 +02:00
Tomáš Hrnčiar
8ca0a0a2d8 Update to 3.11.4 2023-06-08 08:36:11 +02:00
Charalampos Stratakis
64d93401a3 Fixup for CVE-2023-24329 patch name 2023-05-27 00:55:16 +02:00
Lumir Balhar
68ad779a6c Fix for CVE-2023-24329 2023-05-24 14:08:28 +02:00
Tomáš Hrnčiar
7b688dbf92 Update to 3.11.3 2023-04-05 13:51:34 +02:00
Tomáš Hrnčiar
0331299c7d Update to 3.11.2 2023-02-09 11:25:31 +01:00
Miro Hrončok
db4f001692 Don't require pyproject-rpm-macros on RHEL
See also https://src.fedoraproject.org/rpms/pyproject-rpm-macros/pull-request/345
2023-01-20 20:54:07 +00:00
Fedora Release Engineering
85c6584975 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-20 18:45:09 +00:00
Miro Hrončok
01ddee3bb6 Remove any deprecation warnings in asyncio.get_event_loop()
The warnings were added in 3.11.1 and will be reverted in 3.11.2.
They make some Fedora packages fail to build, so we backport the revert.
2023-01-11 15:26:49 +01:00
Miro Hrončok
06ef941d95 Fix asyncio subprocess losing stderr and stdout output
Reported as a regression in https://bodhi.fedoraproject.org/updates/FEDORA-2022-dbb811d203
2023-01-09 13:19:27 +00:00
Miro Hrončok
ec7d75e3d1 Opt-out from https://fedoraproject.org/wiki/Changes/fno-omit-frame-pointer
See https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/6TQYCHMX4FZLF27U5BCEC7IFV6XNBKJP/
for rationale, namely https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/message/ZVDEXGPU6JQFXB3XHYZ4IXVQNNR3YM3V/

Summary: Python is currently slower with frame pointers
due to a slowdown in _PyEval_EvalFrameDefault,
but we expect this to be solved in Python 3.12.

Tracking bugzilla: https://bugzilla.redhat.com/2158729

This change does not require a release bump.
It is only needed to be here to prevent the next builds from including frame pointers.
2023-01-06 12:05:28 +01:00
Miro Hrončok
11c77ae388 No longer patch the default bytecode cache invalidation policy
That is, drop patch 328.

Fixes https://bugzilla.redhat.com/2133850

See also https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/154

This is part of https://fedoraproject.org/wiki/Changes/ReproducibleBuildsClampMtimes
2022-12-19 17:21:06 +01:00
Tomáš Hrnčiar
19bf071b14 Update to 3.11.1 2022-12-07 12:05:59 +01:00
Miro Hrončok
58109b55ab Update to 3.11.0 2022-10-25 00:46:26 +02:00
Miro Hrončok
2d80073286 Update the license tag to SPDX
See https://gitlab.com/fedora/legal/fedora-license-data/-/merge_requests/61

The LICENSE file differs from the text at https://spdx.org/licenses/Python-2.0.1.html
only by:

 - not saying "Python 2.0.1" but "Python" which is considered OK
 - copyright years which is considered OK
 - formatting
 - listing the history and license for code examples from the documentation
   (the documentation is not shipped via this package)
2022-09-13 13:30:06 +02:00
Miro Hrončok
38b3f29b55 Update to 3.11.0rc2 2022-09-13 11:00:55 +02:00
Miro Hrončok
216f3d53bc rpminspect: Explicitly list allowed badfuncs in the _socket module
See https://github.com/rpminspect/rpminspect/pull/805
2022-09-05 17:32:25 +00:00
Miro Hrončok
0c6709aa13 rpmlint: Remove a superfluous space in one of the filters
The warnings look like:

    python3.11-debugsource.x86_64: W: files-duplicate /usr/src/debug/python3.11-3.11.0~rc1-2.fc38.x86_64/build/optimized/Include/pydtrace_probes.h /usr/src/debug/python3.11-3.11.0~rc1-2.fc38.x86_64/build/debug/Include/pydtrace_probes.h
    python3.11-debugsource.x86_64: W: files-duplicate /usr/src/debug/python3.11-3.11.0~rc1-2.fc38.x86_64/build/optimized/Modules/config.c /usr/src/debug/python3.11-3.11.0~rc1-2.fc38.x86_64/build/debug/Modules/config.c
    python3.11-debugsource.x86_64: W: files-duplicate /usr/src/debug/python3.11-3.11.0~rc1-2.fc38.x86_64/build/optimized/Python/deepfreeze/deepfreeze.c /usr/src/debug/python3.11-3.11.0~rc1-2.fc38.x86_64/build/debug/Python/deepfreeze/deepfreeze.c
    python3.11-debugsource.x86_64: W: files-duplicate /usr/src/debug/python3.11-3.11.0~rc1-2.fc38.x86_64/build/optimized/Python/frozen_modules/getpath.h /usr/src/debug/python3.11-3.11.0~rc1-2.fc38.x86_64/build/debug/Python/frozen_modules/getpath.h
2022-09-05 11:20:40 +02:00
Miro Hrončok
a71ba97787 Add more rpmlint rules to avoid all reports we see and don't care about 2022-08-23 15:12:53 +00:00
Miro Hrončok
252afb8c11 Update rpmlintrc to rpmlint 2
- Rename to rpmlint.toml
- Change from Python function calls to TOML list
- Remove rpmlint 1.1 workarounds
- Add rpmlint 2.2 workarounds
- Adjusts some filters to match rpmlint 2.2 messages
2022-08-23 15:12:53 +00:00
Miro Hrončok
d75ca77a64 Don't use custom installation schemes 2022-08-17 14:57:24 +02:00
Tomáš Hrnčiar
ab88d7f86c Update to 3.11.0rc1 2022-08-08 16:04:49 +02:00
Tomáš Hrnčiar
9518f2915c Update to 3.11.0b5 2022-07-26 13:55:26 +02:00
Fedora Release Engineering
2742991dbe Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-22 23:46:54 +00:00
Miro Hrončok
44b7dd93c4 CI tests config: Define and reuse the pybasever variable
This will make future changes easier to backport to other Python versions.

Note that with jinja2 expressions, we need to quote them to preserve valid yaml, see:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#when-to-quote-variables-a-yaml-gotcha
2022-07-12 15:56:13 +00:00
Miro Hrončok
b2d80045f9 Update to 3.11.0b4
Patches 383 and 384 were merged upstream.
Patch 385 was partially merged upstream, the PR with test is still open.
2022-07-12 00:52:25 +02:00
Miro Hrončok
c7432171d0 Finish bootstrap of the re module speed regression fix 2022-07-09 01:23:18 +02:00
Miro Hrončok
0b91c9eccc Fix speed regression in the re module which prevented chromium from building
For details, see https://github.com/python/cpython/issues/94675

Backported from upstream 3.11 branch + https://github.com/python/cpython/pull/94685

Needs bootstrap for test_distutils (assert _sre.MAGIC == MAGIC, "SRE module mismatch").
2022-07-08 19:30:05 +02:00
Tomáš Hrnčiar
7ce324c29a Add patches #371 & #384
Clear and reset sqlite3 statements properly in cursor iternext (fixes rhbz#2099049)
Revert a problematic fix of threading._shutdown() again (fixes rhbz#2100282)
2022-06-24 12:22:45 +02:00
Miro Hrončok
17d458f006 Build Python with the optimized Blake2 library libb2
See https://github.com/python/cpython/issues/91251

> Distributors are encouraged to build Python with the optimized Blake2
> library libb2.
2022-06-23 12:32:46 +00:00
Tomáš Hrnčiar
73f080a859 Fedora CI: Make CI tests compatible with both main and non-main Python 2022-06-23 11:12:45 +02:00
Miro Hrončok
d4eda6057a rpminspect: exclude the debug build from annocheck entirely 2022-06-21 20:50:42 +00:00
Miro Hrončok
a5905dea5f Make C++ version of _Py_CAST work with 0/NULL 2022-06-21 12:50:11 +02:00
Tomáš Hrnčiar
3a1b573f2d Finish bootstrapping for Python 3.11 mass rebuild 2022-06-13 13:39:47 +02:00
Tomáš Hrnčiar
135d879194 Initial bootstrap for Python 3.11 mass rebuild 2022-06-13 11:58:44 +02:00
Miro Hrončok
d6b108d1a6 Update to 3.11.0b3
Patch 381 was merged upstream
(it was the motivation for an expedited release).
2022-06-01 19:08:32 +02:00
Miro Hrončok
4e62ac5fa9 Ensure that AST nodes without explicit end positions can be compiled 2022-06-01 01:08:48 +02:00
Miro Hrončok
f8d78fe8c7 Update to 3.11.0b2 2022-05-31 21:47:45 +02:00
Miro Hrončok
d7833ee876 Don't hardcode %{ABIFLAGS_debug} 2022-05-31 21:47:45 +02:00
Miro Hrončok
f43b8c104e Don't exclude files that don't exist
When built without debug_build, RPM warns:

    File not found: /builddir/build/BUILDROOT/python3.11-3.11.0~b2-1.fc37.x86_64/usr/lib64/python3.11/_sysconfigdata_d_linux_x86_64-linux-gnu.py
    File not found: /builddir/build/BUILDROOT/python3.11-3.11.0~b2-1.fc37.x86_64/usr/lib64/python3.11/__pycache__/_sysconfigdata_d_linux_x86_64-linux-gnu.cpython-311*.pyc

This might become an error in some distant future.
2022-05-31 21:47:45 +02:00
Tomáš Hrnčiar
ac73e8a04f Finish bootstrapping 3.11.0b1 2022-05-10 12:56:18 +02:00
Tomáš Hrnčiar
1993f3aaf2 Update to 3.11.0b1 2022-05-10 11:47:06 +02:00
Tomas Orsava
0ff6a2eef6 Move _sysconfigdata_d_linux*.py to the debug subpackage 2022-04-29 12:24:01 +02:00
Tomas Orsava
bc0e6d534a Remove an rpmlintrc rule that was only relevant to flatpackages 2022-04-29 12:24:01 +02:00
Tomas Orsava
93bef0917d Drop old no-longer-needed Obsoletes of python311 and python3-tools 2022-04-29 12:24:00 +02:00
Tomas Orsava
ff6e0ec3a6 Do not Recommend python*-pip if this is not the main_python
Because we do not ship pip for alternative stacks (outside of `venv`).
2022-04-29 12:23:42 +02:00
Tomas Orsava
294b2649fb Add new bcond for python_abi_provides_for_alt_pythons
By default enabled on EL, disabled on Fedora
2022-04-29 12:23:42 +02:00
Tomas Orsava
6019a968b0 Obsolete python3.X-foo from individual subpackages
e.g. python3-devel now Obsoletes python3.X-devel

We are contemplating splitting alternative Pythons into subpackages, so we need to obsolete each of them from the main Python version.
Related: rhbz#2063227
2022-04-29 12:23:42 +02:00
Tomas Orsava
fad16c3521 Let there *not* be flatpackage
Remove the flatpackage bcond entirely
2022-04-29 12:23:41 +02:00
Tomas Orsava
46f7eeb836 Build Python 3.11 with subpackages (by disabling the flatpackage bcond)
No change in not providing `python(abi)` for alternative Python versions

Resolves: rhbz#2063227
2022-04-29 12:22:51 +02:00
Tomáš Hrnčiar
193c0d331e Finish bootstrapping 3.11.0a7 2022-04-07 10:59:25 +02:00
Tomáš Hrnčiar
113681a061 Update to 3.11.0a7, in bootstrap mode 2022-04-07 08:15:36 +02:00
Miro Hrončok
483c098fba Finish bootstrapping 3.11.0a6 2022-03-08 12:57:38 +01:00
Miro Hrončok
b082002382 CI: Temporarily opt-out from Cython part of the smoke test, 3.11.0a6 breaks is once again 2022-03-08 10:31:06 +01:00
Miro Hrončok
6a8d633a93 Update to 3.11.0a6, in bootstrap mode 2022-03-07 20:18:37 +01:00
Tomáš Hrnčiar
83ff9b9200 Update to 3.11.0a5 2022-02-04 13:14:43 +01:00
Fedora Release Engineering
a0869c012a - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-21 16:48:54 +00:00
Tomáš Hrnčiar
0fad4d6fae Update to 3.11.0a4 2022-01-17 16:23:56 +01:00
Miro Hrončok
d7572e7d38 Rebuilt for https://fedoraproject.org/wiki/Changes/LIBFFI34 2022-01-08 11:12:38 +01:00
Miro Hrončok
771f810493 Supplement tox
See https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/NVVUXSVSPFQOWIGBE2JNI67HEO7R63ZQ/
2021-12-13 14:14:04 +01:00
Tomáš Hrnčiar
9ff3c68643 Update to 3.11.0a3
Bootstrap bcond is flipped because this update solves the issue when python3.11
didn't built with --without-bootstrap.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2025026
2021-12-10 16:41:02 +01:00
Tomas Orsava
c4313879e7 Use new macros %python_wheel_dir and %python_wheel_pkg_prefix
..for build/requiring wheel packages and for the file location.
This does not actually change the name or the contents of the subpackage.
2021-11-25 12:20:35 +00:00
Tomáš Hrnčiar
651691580e Update to 3.11.0a2
Patch 251 was updated to include specific install scheme for virtualenv
2021-11-15 15:21:45 +01:00
Björn Esser
3dd3c0a42b
Rebuild(libnsl2)
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
2021-11-12 22:26:57 +01:00
10 changed files with 649 additions and 341 deletions

View File

@ -1,41 +1,70 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lumir Balhar <lbalhar@redhat.com> From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Mon, 15 Feb 2021 12:19:27 +0100 Date: Mon, 15 Feb 2021 12:19:27 +0100
Subject: [PATCH] 00251: Change user install location Subject: [PATCH] 00251: Change user install location
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit Content-Transfer-Encoding: 8bit
Change the values of sysconfig's "posix_prefix" install scheme to /usr/local Set values of base and platbase in sysconfig from /usr
when RPM build or venv/virtualenv is not detected, to /usr/local when RPM build is not detected
to make pip, sysconfig and distutils install into an isolated location. to make pip and similar tools install into separate location.
The original values are saved as an additional "rpm_prefix" install scheme. Set values of prefix and exec_prefix in distutils install command
to /usr/local if executable is /usr/bin/python* and RPM build
The site module adds the /usr/local paths to sys.path when site packages are is not detected to make distutils and pypa/distutils install into separate location.
enabled and RPM build is not detected.
Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
Downstream only.
Rewrote in Fedora 36+ to patch sysconfig instead of distutils, We've tried to rework in Fedora 36/Python 3.10 to follow https://bugs.python.org/issue43976
see https://discuss.python.org/t/pep-632-deprecate-distutils-module/5134/104 but we have identified serious problems with that approach,
see https://bugzilla.redhat.com/2026979 or https://bugzilla.redhat.com/2097183
Downstream only for now, waiting for https://bugs.python.org/issue43976 pypa/distutils integration: https://github.com/pypa/distutils/pull/70
Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Miro Hrončok <miro@hroncok.cz> Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Michal Cyprian <m.cyprian@gmail.com> Co-authored-by: Michal Cyprian <m.cyprian@gmail.com>
Co-authored-by: Lumír Balhar <frenzy.madness@gmail.com>
--- ---
Lib/site.py | 9 ++++++++- Lib/distutils/command/install.py | 8 ++++--
Lib/sysconfig.py | 19 +++++++++++++++++++ Lib/site.py | 9 +++++-
Lib/test/test_sysconfig.py | 4 +++- Lib/sysconfig.py | 49 +++++++++++++++++++++++++++++++-
3 files changed, 30 insertions(+), 2 deletions(-) Lib/test/test_sysconfig.py | 17 +++++++++--
4 files changed, 77 insertions(+), 6 deletions(-)
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
index 01d5331a63..79f70f0de4 100644
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -159,6 +159,8 @@ class install(Command):
negative_opt = {'no-compile' : 'compile'}
+ # Allow Fedora to add components to the prefix
+ _prefix_addition = getattr(sysconfig, '_prefix_addition', '')
def initialize_options(self):
"""Initializes options."""
@@ -441,8 +443,10 @@ def finalize_unix(self):
raise DistutilsOptionError(
"must not supply exec-prefix without prefix")
- self.prefix = os.path.normpath(sys.prefix)
- self.exec_prefix = os.path.normpath(sys.exec_prefix)
+ self.prefix = (
+ os.path.normpath(sys.prefix) + self._prefix_addition)
+ self.exec_prefix = (
+ os.path.normpath(sys.exec_prefix) + self._prefix_addition)
else:
if self.exec_prefix is None:
diff --git a/Lib/site.py b/Lib/site.py diff --git a/Lib/site.py b/Lib/site.py
index 939893eb5e..d1316c3355 100644 index 69670d9d7f..104cb93899 100644
--- a/Lib/site.py --- a/Lib/site.py
+++ b/Lib/site.py +++ b/Lib/site.py
@@ -380,8 +380,15 @@ def getsitepackages(prefixes=None): @@ -377,8 +377,15 @@ def getsitepackages(prefixes=None):
return sitepackages return sitepackages
def addsitepackages(known_paths, prefixes=None): def addsitepackages(known_paths, prefixes=None):
@ -53,49 +82,118 @@ index 939893eb5e..d1316c3355 100644
if os.path.isdir(sitedir): if os.path.isdir(sitedir):
addsitedir(sitedir, known_paths) addsitedir(sitedir, known_paths)
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index 95b48f6429..226b55a556 100644 index ebe3711827..55af57b335 100644
--- a/Lib/sysconfig.py --- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py +++ b/Lib/sysconfig.py
@@ -58,6 +58,25 @@ @@ -103,6 +103,11 @@
}, else:
} _INSTALL_SCHEMES['venv'] = _INSTALL_SCHEMES['posix_venv']
+# backup the original posix_prefix as rpm_prefix +# For a brief period of time in the Fedora 36 life cycle,
+# RPM packages use it and we need to be able to read it even when changed +# this installation scheme existed and was documented in the release notes.
+# For backwards compatibility, we keep it here (at least on 3.10 and 3.11).
+_INSTALL_SCHEMES['rpm_prefix'] = _INSTALL_SCHEMES['posix_prefix'] +_INSTALL_SCHEMES['rpm_prefix'] = _INSTALL_SCHEMES['posix_prefix']
+ +
+if (not (hasattr(sys, 'real_prefix') or
+ sys.prefix != sys.base_prefix) and
+ 'RPM_BUILD_ROOT' not in os.environ):
+ _INSTALL_SCHEMES['posix_prefix'] = {
+ 'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}',
+ 'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}',
+ 'purelib': '{base}/local/lib/python{py_version_short}/site-packages',
+ 'platlib': '{platbase}/local/{platlibdir}/python{py_version_short}/site-packages',
+ 'include':
+ '{installed_base}/include/python{py_version_short}{abiflags}',
+ 'platinclude':
+ '{installed_platbase}/include/python{py_version_short}{abiflags}',
+ 'scripts': '{base}/local/bin',
+ 'data': '{base}/local',
+ }
# NOTE: site.py has copy of this function. # NOTE: site.py has copy of this function.
# Sync it when modify this function. # Sync it when modify this function.
@@ -162,6 +167,19 @@ def joinuser(*args):
},
}
+# This is used by distutils.command.install in the stdlib
+# as well as pypa/distutils (e.g. bundled in setuptools).
+# The self.prefix value is set to sys.prefix + /local/
+# if neither RPM build nor virtual environment is
+# detected to make distutils install packages
+# into the separate location.
+# https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
+if (not (hasattr(sys, 'real_prefix') or
+ sys.prefix != sys.base_prefix) and
+ 'RPM_BUILD_ROOT' not in os.environ):
+ _prefix_addition = '/local'
+
+
_SCHEME_KEYS = ('stdlib', 'platstdlib', 'purelib', 'platlib', 'include',
'scripts', 'data')
@@ -258,11 +276,40 @@ def _extend_dict(target_dict, other_dict):
target_dict[key] = value
+_CONFIG_VARS_LOCAL = None
+
+
+def _config_vars_local():
+ # This function returns the config vars with prefixes amended to /usr/local
+ # https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
+ global _CONFIG_VARS_LOCAL
+ if _CONFIG_VARS_LOCAL is None:
+ _CONFIG_VARS_LOCAL = dict(get_config_vars())
+ _CONFIG_VARS_LOCAL['base'] = '/usr/local'
+ _CONFIG_VARS_LOCAL['platbase'] = '/usr/local'
+ return _CONFIG_VARS_LOCAL
+
+
def _expand_vars(scheme, vars):
res = {}
if vars is None:
vars = {}
- _extend_dict(vars, get_config_vars())
+
+ # when we are not in a virtual environment or an RPM build
+ # we change '/usr' to '/usr/local'
+ # to avoid surprises, we explicitly check for the /usr/ prefix
+ # Python virtual environments have different prefixes
+ # we only do this for posix_prefix, not to mangle the venv scheme
+ # posix_prefix is used by sudo pip install
+ # we only change the defaults here, so explicit --prefix will take precedence
+ # https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
+ if (scheme == 'posix_prefix' and
+ _PREFIX == '/usr' and
+ 'RPM_BUILD_ROOT' not in os.environ):
+ _extend_dict(vars, _config_vars_local())
+ else:
+ _extend_dict(vars, get_config_vars())
+
if os.name == 'nt':
# On Windows we want to substitute 'lib' for schemes rather
# than the native value (without modifying vars, in case it
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index 9408657c91..db4cbc55ec 100644 index d96371d242..72b028435f 100644
--- a/Lib/test/test_sysconfig.py --- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py
@@ -263,7 +263,7 @@ def test_get_config_h_filename(self): @@ -111,8 +111,19 @@ def test_get_path(self):
for scheme in _INSTALL_SCHEMES:
for name in _INSTALL_SCHEMES[scheme]:
expected = _INSTALL_SCHEMES[scheme][name].format(**config_vars)
+ tested = get_path(name, scheme)
+ # https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
+ if tested.startswith('/usr/local'):
+ # /usr/local should only be used in posix_prefix
+ self.assertEqual(scheme, 'posix_prefix')
+ # Fedora CI runs tests for venv and virtualenv that check for other prefixes
+ self.assertEqual(sys.prefix, '/usr')
+ # When building the RPM of Python, %check runs this with RPM_BUILD_ROOT set
+ # Fedora CI runs this with RPM_BUILD_ROOT unset
+ self.assertNotIn('RPM_BUILD_ROOT', os.environ)
+ tested = tested.replace('/usr/local', '/usr')
self.assertEqual(
- os.path.normpath(get_path(name, scheme)),
+ os.path.normpath(tested),
os.path.normpath(expected),
)
@@ -336,7 +347,7 @@ def test_get_config_h_filename(self):
self.assertTrue(os.path.isfile(config_h), config_h) self.assertTrue(os.path.isfile(config_h), config_h)
def test_get_scheme_names(self): def test_get_scheme_names(self):
- wanted = ['nt', 'posix_home', 'posix_prefix'] - wanted = ['nt', 'posix_home', 'posix_prefix', 'posix_venv', 'nt_venv', 'venv']
+ wanted = ['nt', 'posix_home', 'posix_prefix', 'rpm_prefix'] + wanted = ['nt', 'posix_home', 'posix_prefix', 'posix_venv', 'nt_venv', 'venv', 'rpm_prefix']
if HAS_USER_BASE: if HAS_USER_BASE:
wanted.extend(['nt_user', 'osx_framework_user', 'posix_user']) wanted.extend(['nt_user', 'osx_framework_user', 'posix_user'])
self.assertEqual(get_scheme_names(), tuple(sorted(wanted))) self.assertEqual(get_scheme_names(), tuple(sorted(wanted)))
@@ -274,6 +274,8 @@ def test_symlink(self): # Issue 7880 @@ -348,6 +359,8 @@ def test_symlink(self): # Issue 7880
cmd = "-c", "import sysconfig; print(sysconfig.get_platform())" cmd = "-c", "import sysconfig; print(sysconfig.get_platform())"
self.assertEqual(py.call_real(*cmd), py.call_link(*cmd)) self.assertEqual(py.call_real(*cmd), py.call_link(*cmd))

View File

@ -1,54 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Thu, 11 Jul 2019 13:44:13 +0200
Subject: [PATCH] 00328: Restore pyc to TIMESTAMP invalidation mode as default
in rpmbuild
Since Fedora 31, the $SOURCE_DATE_EPOCH is set in rpmbuild to the latest
%changelog date. This makes Python default to the CHECKED_HASH pyc
invalidation mode, bringing more reproducible builds traded for an import
performance decrease. To avoid that, we don't default to CHECKED_HASH
when $RPM_BUILD_ROOT is set (i.e. when we are building RPM packages).
See https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/57#comment-27426
Downstream only: only used when building RPM packages
Ideally, we should talk to upstream and explain why we don't want this
---
Lib/py_compile.py | 3 ++-
Lib/test/test_py_compile.py | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/Lib/py_compile.py b/Lib/py_compile.py
index 0f9b59025c..59dc3fe50b 100644
--- a/Lib/py_compile.py
+++ b/Lib/py_compile.py
@@ -70,7 +70,8 @@ class PycInvalidationMode(enum.Enum):
def _get_default_invalidation_mode():
- if os.environ.get('SOURCE_DATE_EPOCH'):
+ if (os.environ.get('SOURCE_DATE_EPOCH') and not
+ os.environ.get('RPM_BUILD_ROOT')):
return PycInvalidationMode.CHECKED_HASH
else:
return PycInvalidationMode.TIMESTAMP
diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py
index 5ed98dbff1..f30c4e43de 100644
--- a/Lib/test/test_py_compile.py
+++ b/Lib/test/test_py_compile.py
@@ -19,6 +19,7 @@ def without_source_date_epoch(fxn):
def wrapper(*args, **kwargs):
with os_helper.EnvironmentVarGuard() as env:
env.unset('SOURCE_DATE_EPOCH')
+ env.unset('RPM_BUILD_ROOT')
return fxn(*args, **kwargs)
return wrapper
@@ -29,6 +30,7 @@ def with_source_date_epoch(fxn):
def wrapper(*args, **kwargs):
with os_helper.EnvironmentVarGuard() as env:
env['SOURCE_DATE_EPOCH'] = '123456789'
+ env.unset('RPM_BUILD_ROOT')
return fxn(*args, **kwargs)
return wrapper

View File

@ -0,0 +1,103 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
Date: Tue, 7 Dec 2021 14:41:59 +0100
Subject: [PATCH] 00371: Revert "bpo-1596321: Fix threading._shutdown() for the
main thread (GH-28549) (GH-28589)"
This reverts commit 38c67738c64304928c68d5c2bd78bbb01d979b94. It
introduced regression causing FreeIPA's tests to fail.
For more info see:
https://bodhi.fedoraproject.org/updates/FEDORA-2021-e152ce5f31
https://github.com/GrahamDumpleton/mod_wsgi/issues/730
---
Lib/test/test_threading.py | 33 ---------------------------------
Lib/threading.py | 25 ++++++++-----------------
2 files changed, 8 insertions(+), 50 deletions(-)
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 9c6561c099..84714c03fe 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -956,39 +956,6 @@ def test_debug_deprecation(self):
b'is deprecated and will be removed in Python 3.12')
self.assertIn(msg, err)
- def test_import_from_another_thread(self):
- # bpo-1596321: If the threading module is first import from a thread
- # different than the main thread, threading._shutdown() must handle
- # this case without logging an error at Python exit.
- code = textwrap.dedent('''
- import _thread
- import sys
-
- event = _thread.allocate_lock()
- event.acquire()
-
- def import_threading():
- import threading
- event.release()
-
- if 'threading' in sys.modules:
- raise Exception('threading is already imported')
-
- _thread.start_new_thread(import_threading, ())
-
- # wait until the threading module is imported
- event.acquire()
- event.release()
-
- if 'threading' not in sys.modules:
- raise Exception('threading is not imported')
-
- # don't wait until the thread completes
- ''')
- rc, out, err = assert_python_ok("-c", code)
- self.assertEqual(out, b'')
- self.assertEqual(err, b'')
-
class ThreadJoinOnShutdown(BaseTestCase):
diff --git a/Lib/threading.py b/Lib/threading.py
index 4f72938551..18c10e6489 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -1546,29 +1546,20 @@ def _shutdown():
global _SHUTTING_DOWN
_SHUTTING_DOWN = True
+ # Main thread
+ tlock = _main_thread._tstate_lock
+ # The main thread isn't finished yet, so its thread state lock can't have
+ # been released.
+ assert tlock is not None
+ assert tlock.locked()
+ tlock.release()
+ _main_thread._stop()
# Call registered threading atexit functions before threads are joined.
# Order is reversed, similar to atexit.
for atexit_call in reversed(_threading_atexits):
atexit_call()
- # Main thread
- if _main_thread.ident == get_ident():
- tlock = _main_thread._tstate_lock
- # The main thread isn't finished yet, so its thread state lock can't
- # have been released.
- assert tlock is not None
- assert tlock.locked()
- tlock.release()
- _main_thread._stop()
- else:
- # bpo-1596321: _shutdown() must be called in the main thread.
- # If the threading module was not imported by the main thread,
- # _main_thread is the thread which imported the threading module.
- # In this case, ignore _main_thread, similar behavior than for threads
- # spawned by C libraries or using _thread.start_new_thread().
- pass
-
# Join all non-deamon threads
while True:
with _shutdown_locks_lock:

View File

@ -19,11 +19,9 @@ not_compiled = [
'*/test/bad_coding.py', '*/test/bad_coding.py',
'*/test/bad_coding2.py', '*/test/bad_coding2.py',
'*/test/badsyntax_*.py', '*/test/badsyntax_*.py',
'*/lib2to3/tests/data/bom.py', '*/lib2to3/tests/data/*.py',
'*/lib2to3/tests/data/crlf.py', '*/lib2to3/tests/data/*/*.py',
'*/lib2to3/tests/data/different_encoding.py', '*/lib2to3/tests/data/*/*/*.py',
'*/lib2to3/tests/data/false_encoding.py',
'*/lib2to3/tests/data/py2_test_grammar.py',
'*.debug-gdb.py', '*.debug-gdb.py',
] ]

View File

@ -1,98 +0,0 @@
# KNOWN BUGS:
# https://bugzilla.redhat.com/show_bug.cgi?id=1489816
addFilter(r'crypto-policy-non-compliance-openssl')
# TESTS:
addFilter(r'(zero-length|pem-certificate|uncompressed-zip) /usr/lib(64)?/python3\.\d+/test')
# OTHER DELIBERATES:
# chroot function
addFilter(r'missing-call-to-chdir-with-chroot')
# intentionally unversioned and selfobsoleted
addFilter(r'unversioned-explicit-obsoletes python')
addFilter(r'unversioned Obsoletes: Obsoletes: python3\.\d+$')
addFilter(r'self-obsoletion python3\.\d+ obsoletes python3\.\d+')
# intentionally hardcoded
addFilter(r'hardcoded-library-path in %{_prefix}/lib/(debug/%{_libdir}|python%{pybasever})')
# intentional for our pythonXY package
addFilter(r'python3\.\d+\.[^:]+: (E|W): devel-file-in-non-devel-package')
# we have non binary stuff, python files
addFilter(r'only-non-binary-in-usr-lib')
# some devel files that are deliberately needed
addFilter(r'devel-file-in-non-devel-package /usr/include/python3\.\d+m?/pyconfig-(32|64)\.h')
addFilter(r'devel-file-in-non-devel-package /usr/lib(64)?/python3\.\d+/distutils/tests/xxmodule\.c')
# some bytecode is shipped without sources on purpose, as a space optimization
# if this regex needs to be relaxed in the future, make sure it **does not** match pyc files in __pycache__
addFilter(r'python-bytecode-without-source /usr/lib(64)?/python3\.\d+/(encodings|pydoc_data)/[^/]+.pyc')
# SORRY, NOT SORRY:
# manual pages
addFilter(r'no-manual-page-for-binary (idle|pydoc|pyvenv|2to3|python3?-debug|pathfix|msgfmt|pygettext)')
addFilter(r'no-manual-page-for-binary python3?.*-config$')
addFilter(r'no-manual-page-for-binary python3\.\d+dm?$')
# missing documentation from subpackages
addFilter(r'^python3(\.\d+)?-(debug|tkinter|test|idle)\.[^:]+: (E|W): no-documentation')
# platform python is obsoleted, but not provided
addFilter(r'obsolete-not-provided platform-python')
# we have extra tokens at the end of %endif/%else directives, we consider them useful
addFilter(r'extra tokens at the end of %(endif|else) directive')
# RPMLINT IMPERFECTIONS
# https://github.com/rpm-software-management/rpmlint/issues/123
addFilter(r'python-bytecode-wrong-magic-value .* expected 33\d\d \(3\.7\), found 3393')
# https://github.com/rpm-software-management/rpmlint/pull/133
addFilter(r'python-bytecode-wrong-magic-value .* expected 33\d\d \(3\.7\), found 3394')
# https://bugzilla.redhat.com/show_bug.cgi?id=1550562
# https://github.com/rpm-software-management/rpmlint/issues/128
addFilter(r'python-bytecode-inconsistent-mtime .* 1970')
# we provide python(abi) manually to be sure. createrepo will merge this with the automatic
addFilter(r'python3(\.\d+)?\.[^:-]+: (E|W): useless-provides python\(abi\)')
# debugsource
addFilter(r'^python3(\.\d+)?-debugsource\.[^:]+: (E|W): no-documentation')
# debuginfo
addFilter(r'^python3(\.\d+)?-debuginfo\.[^:]+: (E|W): useless-provides debuginfo\(build-id\)')
# this is OK for F28+
addFilter(r'library-without-ldconfig-post')
# debug package contains devel and non-devel files
addFilter(r'python3(\.\d+)?-debug\.[^:]+: (E|W): (non-)?devel-file-in-(non-)?devel-package')
# this goes to other subpackage, hence not actually dangling, the read error is bogus
addFilter(r'dangling-relative-symlink /usr/lib(64)?/pkgconfig/python-3\.\d+dm?(-embed)?\.pc python-3\.\d+(-embed)?\.pc')
addFilter(r'read-error /usr/lib(64)?/pkgconfig/python-3\.\d+dm?(-embed)?\.pc \[Errno 2\]')
# the python-unversioned-command package contains dangling symlinks by design
addFilter(r'^python-unversioned-command\.[^:]+: (E|W): dangling-relative-symlink '
r'(/usr/bin/python \./python3|/usr/share/man/man1/python\.1\S* ./python3\.1\S*)$')
# we need this macro to evaluate, even if the line starts with #
addFilter(r'macro-in-comment %\{_pyconfig(32|64)_h\}')
# Python modules don't need to be linked against libc
# Since 3.8 they are no longer linked against libpython3.8.so.1.0
addFilter(r'(E|W): library-not-linked-against-libc /usr/lib(64)?/python3\.\d+/lib-dynload/')
addFilter(r'(E|W): shared-lib-without-dependency-information /usr/lib(64)?/python3\.\d+/lib-dynload/')
# specfile-errors are listed twice, once with reason and once without
# we filter out the empty ones
addFilter(r'\bpython3(\.\d+)?\.(src|spec): (E|W): specfile-error\s+$')
# SPELLING ERRORS
addFilter(r'spelling-error .* en_US (bytecode|pyc|filename|tkinter|namespaces|pytest) ')

View File

@ -13,12 +13,12 @@ URL: https://www.python.org/
# WARNING When rebasing to a new Python version, # WARNING When rebasing to a new Python version,
# remember to update the python3-docs package as well # remember to update the python3-docs package as well
%global general_version %{pybasever}.0 %global general_version %{pybasever}.4
%global prerel a1 #global prerel ...
%global upstream_version %{general_version}%{?prerel} %global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}} Version: %{general_version}%{?prerel:~%{prerel}}
Release: 1%{?dist} Release: 2%{?dist}
License: Python License: Python-2.0.1
# ================================== # ==================================
@ -31,7 +31,6 @@ License: Python
# Main Python, i.e. whether this is the main Python version in the distribution # Main Python, i.e. whether this is the main Python version in the distribution
# that owns /usr/bin/python3 and other unique paths # that owns /usr/bin/python3 and other unique paths
# This also means the built subpackages are called python3 rather than python3X # This also means the built subpackages are called python3 rather than python3X
# WARNING: This also influences the flatpackage bcond below.
# By default, this is determined by the %%__default_python3_pkgversion value # By default, this is determined by the %%__default_python3_pkgversion value
%if "%{?__default_python3_pkgversion}" == "%{pybasever}" %if "%{?__default_python3_pkgversion}" == "%{pybasever}"
%bcond_without main_python %bcond_without main_python
@ -39,13 +38,13 @@ License: Python
%bcond_with main_python %bcond_with main_python
%endif %endif
# Flat package, i.e. no separate subpackages # If this is *not* Main Python, should it contain `Provides: python(abi) ...`?
# Default (in Fedora): if this is a main Python, it is not a flatpackage # In Fedora no package shall depend on an alternative Python via this tag, so we do not provide it.
# Not supported: Combination of flatpackage enabled and main_python enabled # In ELN/RHEL/CentOS we want to allow building against alternative stacks, so the Provide is enabled.
%if %{with main_python} %if 0%{?fedora}
%bcond_with flatpackage %bcond_with python_abi_provides_for_alt_pythons
%else %else
%bcond_without flatpackage %bcond_without python_abi_provides_for_alt_pythons
%endif %endif
# When bootstrapping python3, we need to build setuptools. # When bootstrapping python3, we need to build setuptools.
@ -60,7 +59,7 @@ License: Python
# IMPORTANT: When bootstrapping, it's very likely the wheels for pip and # IMPORTANT: When bootstrapping, it's very likely the wheels for pip and
# setuptools are not available. Turn off the rpmwheels bcond until # setuptools are not available. Turn off the rpmwheels bcond until
# the two packages are built with wheels to get around the issue. # the two packages are built with wheels to get around the issue.
%bcond_without bootstrap %bcond_with bootstrap
# Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package # Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package
# Uses upstream bundled prebuilt wheels otherwise # Uses upstream bundled prebuilt wheels otherwise
@ -68,8 +67,8 @@ License: Python
# If the rpmwheels condition is disabled, we use the bundled wheel packages # If the rpmwheels condition is disabled, we use the bundled wheel packages
# from Python with the versions below. # from Python with the versions below.
# This needs to be manually updated when we update Python. # This needs to be manually updated when we update Python.
%global pip_version 21.2.3 %global pip_version 23.1.2
%global setuptools_version 57.4.0 %global setuptools_version 65.5.0
# Expensive optimizations (mainly, profile-guided optimizations) # Expensive optimizations (mainly, profile-guided optimizations)
%bcond_without optimizations %bcond_without optimizations
@ -79,11 +78,7 @@ License: Python
# Extra build for debugging the interpreter or C-API extensions # Extra build for debugging the interpreter or C-API extensions
# (the -debug subpackages) # (the -debug subpackages)
%if %{with flatpackage}
%bcond_with debug_build
%else
%bcond_without debug_build %bcond_without debug_build
%endif
# Support for the GDB debugger # Support for the GDB debugger
%bcond_without gdb_hooks %bcond_without gdb_hooks
@ -166,6 +161,26 @@ License: Python
%{warn:Doing a main_python build with wrong %%__default_python3_pkgversion (0%{?__default_python3_pkgversion}, but this is %pyshortver)} %{warn:Doing a main_python build with wrong %%__default_python3_pkgversion (0%{?__default_python3_pkgversion}, but this is %pyshortver)}
%endif %endif
%if %{with main_python}
# To keep the upgrade path clean, we Obsolete python3.X from the python3
# package and python3.X-foo from individual subpackages.
# Note that using Obsoletes without package version is not standard practice.
# Here we assert that *any* version of the system's default interpreter is
# preferable to an "extra" interpreter. For example, python3-3.6.1 will
# replace python3.6-3.6.2.
%define unversioned_obsoletes_of_python3_X_if_main() %{expand:\
Obsoletes: python%{pybasever}%{?1:-%{1}}\
}
%else
%define unversioned_obsoletes_of_python3_X_if_main() %{nil}
%endif
# Opt-out from https://fedoraproject.org/wiki/Changes/fno-omit-frame-pointer
# Python is slower with frame pointers, but we expect to remove this in Python 3.12+
# See https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/6TQYCHMX4FZLF27U5BCEC7IFV6XNBKJP/
# Tracking bugzilla: https://bugzilla.redhat.com/2158729
%undefine _include_frame_pointers
# ======================= # =======================
# Build-time requirements # Build-time requirements
# ======================= # =======================
@ -190,6 +205,7 @@ BuildRequires: glibc-devel
BuildRequires: gmp-devel BuildRequires: gmp-devel
BuildRequires: gnupg2 BuildRequires: gnupg2
BuildRequires: libappstream-glib BuildRequires: libappstream-glib
BuildRequires: libb2-devel
BuildRequires: libffi-devel BuildRequires: libffi-devel
BuildRequires: libnsl2-devel BuildRequires: libnsl2-devel
BuildRequires: libtirpc-devel BuildRequires: libtirpc-devel
@ -226,8 +242,8 @@ BuildRequires: /usr/bin/dtrace
BuildRequires: /usr/sbin/ifconfig BuildRequires: /usr/sbin/ifconfig
%if %{with rpmwheels} %if %{with rpmwheels}
BuildRequires: python-setuptools-wheel BuildRequires: %{python_wheel_pkg_prefix}-setuptools-wheel
BuildRequires: python-pip-wheel BuildRequires: %{python_wheel_pkg_prefix}-pip-wheel
%endif %endif
%if %{without bootstrap} %if %{without bootstrap}
@ -267,39 +283,37 @@ Source11: idle3.appdata.xml
# Was Patch0 in ivazquez' python3000 specfile # Was Patch0 in ivazquez' python3000 specfile
Patch1: 00001-rpath.patch Patch1: 00001-rpath.patch
# 00251 # 0952e38e5bf725ebbab48b13a35566e30635ddf8 # 00251 # af0f1ba72e01cb93371ff21fb7ca889daa43fa7a
# Change user install location # Change user install location
# #
# Change the values of sysconfig's "posix_prefix" install scheme to /usr/local # Set values of base and platbase in sysconfig from /usr
# when RPM build or venv/virtualenv is not detected, # to /usr/local when RPM build is not detected
# to make pip, sysconfig and distutils install into an isolated location. # to make pip and similar tools install into separate location.
# #
# The original values are saved as an additional "rpm_prefix" install scheme. # Set values of prefix and exec_prefix in distutils install command
# # to /usr/local if executable is /usr/bin/python* and RPM build
# The site module adds the /usr/local paths to sys.path when site packages are # is not detected to make distutils and pypa/distutils install into separate location.
# enabled and RPM build is not detected.
# #
# Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe # Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
# Downstream only.
# #
# Rewrote in Fedora 36+ to patch sysconfig instead of distutils, # We've tried to rework in Fedora 36/Python 3.10 to follow https://bugs.python.org/issue43976
# see https://discuss.python.org/t/pep-632-deprecate-distutils-module/5134/104 # but we have identified serious problems with that approach,
# see https://bugzilla.redhat.com/2026979 or https://bugzilla.redhat.com/2097183
# #
# Downstream only for now, waiting for https://bugs.python.org/issue43976 # pypa/distutils integration: https://github.com/pypa/distutils/pull/70
Patch251: 00251-change-user-install-location.patch Patch251: 00251-change-user-install-location.patch
# 00328 # 318e500c98f5e59eb1f23e0fcd32db69b9bd17e1 # 00371 # c1754d9c2750f89cb702e1b63a99201f5f7cff00
# Restore pyc to TIMESTAMP invalidation mode as default in rpmbuild # Revert "bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549) (GH-28589)"
# #
# Since Fedora 31, the $SOURCE_DATE_EPOCH is set in rpmbuild to the latest # This reverts commit 38c67738c64304928c68d5c2bd78bbb01d979b94. It
# %%changelog date. This makes Python default to the CHECKED_HASH pyc # introduced regression causing FreeIPA's tests to fail.
# invalidation mode, bringing more reproducible builds traded for an import
# performance decrease. To avoid that, we don't default to CHECKED_HASH
# when $RPM_BUILD_ROOT is set (i.e. when we are building RPM packages).
# #
# See https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/57#comment-27426 # For more info see:
# Downstream only: only used when building RPM packages # https://bodhi.fedoraproject.org/updates/FEDORA-2021-e152ce5f31
# Ideally, we should talk to upstream and explain why we don't want this # https://github.com/GrahamDumpleton/mod_wsgi/issues/730
Patch328: 00328-pyc-timestamp-invalidation-mode.patch Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch
# (New patches go here ^^^) # (New patches go here ^^^)
# #
@ -319,8 +333,7 @@ Patch328: 00328-pyc-timestamp-invalidation-mode.patch
# Descriptions, and metadata for subpackages # Descriptions, and metadata for subpackages
# ========================================== # ==========================================
# this if branch is ~300 lines long and contains subpackages' definitions
%if %{without flatpackage}
%if %{with main_python} %if %{with main_python}
# Description for the python3X SRPM only: # Description for the python3X SRPM only:
%description %description
@ -333,17 +346,13 @@ third-party libraries.
Summary: Python %{pybasever} interpreter Summary: Python %{pybasever} interpreter
# In order to support multiple Python interpreters for development purposes, # In order to support multiple Python interpreters for development purposes,
# packages with the naming scheme flatpackage (e.g. python3.5) exist for # packages with fully versioned naming scheme (e.g. python3.9*) exist for
# non-default versions of Python 3. # non-default versions of Python 3.
# For consistency, we provide python3.X from python3 as well. # For consistency, we provide python3.X from python3 as well.
Provides: python%{pybasever} = %{version}-%{release} Provides: python%{pybasever} = %{version}-%{release}
Provides: python%{pybasever}%{?_isa} = %{version}-%{release} Provides: python%{pybasever}%{?_isa} = %{version}-%{release}
# To keep the upgrade path clean, we Obsolete python3.X.
# Note that using Obsoletes without package version is not standard practice. %unversioned_obsoletes_of_python3_X_if_main
# Here we assert that *any* version of the system's default interpreter is
# preferable to an "extra" interpreter. For example, python3-3.6.1 will
# replace python3.6-3.6.2.
Obsoletes: python%{pybasever}
# https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package # https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
# https://fedoraproject.org/wiki/Changes/Python_means_Python3 # https://fedoraproject.org/wiki/Changes/Python_means_Python3
@ -356,16 +365,18 @@ Recommends: %{_bindir}/python
# Python interpreter packages used to be named (or provide) name pythonXY (e.g. # Python interpreter packages used to be named (or provide) name pythonXY (e.g.
# python39). However, to align it with the executable names and to prepare for # python39). However, to align it with the executable names and to prepare for
# Python 3.10, they were renamed to pythonX.Y (e.g. python3.9, python3.10). We # Python 3.10, they were renamed to pythonX.Y (e.g. python3.9, python3.10). We
# provide and obsolete the previous names. # provide the previous names.
# - Here are the tags for the nonflat package, regardless if main_python (e.g.
# python3) or not (e.g. python39). For the flat package, the provide is
# repeated many lines later.
Provides: python%{pyshortver} = %{version}-%{release} Provides: python%{pyshortver} = %{version}-%{release}
Obsoletes: python%{pyshortver} < %{version}-%{release}
%if %{with main_python} || %{with python_abi_provides_for_alt_pythons}
# Packages with Python modules in standard locations automatically # Packages with Python modules in standard locations automatically
# depend on python(abi). Provide that here. # depend on python(abi). Provide that here.
Provides: python(abi) = %{pybasever} Provides: python(abi) = %{pybasever}
%else
# We exclude the `python(abi)` Provides
%global __requires_exclude ^python\\(abi\\) = 3\\..+
%global __provides_exclude ^python\\(abi\\) = 3\\..+
%endif
Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release} Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release}
@ -425,13 +436,15 @@ This package contains /usr/bin/python - the "python" command that runs Python 3.
Summary: Python runtime libraries Summary: Python runtime libraries
%if %{with rpmwheels} %if %{with rpmwheels}
Requires: python-setuptools-wheel Requires: %{python_wheel_pkg_prefix}-setuptools-wheel
Requires: python-pip-wheel Requires: %{python_wheel_pkg_prefix}-pip-wheel
%else %else
Provides: bundled(python3dist(pip)) = %{pip_version} Provides: bundled(python3dist(pip)) = %{pip_version}
Provides: bundled(python3dist(setuptools)) = %{setuptools_version} Provides: bundled(python3dist(setuptools)) = %{setuptools_version}
%endif %endif
%unversioned_obsoletes_of_python3_X_if_main libs
# There are files in the standard library that have python shebang. # There are files in the standard library that have python shebang.
# We've filtered the automatic requirement out so libs are installable without # We've filtered the automatic requirement out so libs are installable without
# the main package. This however makes it pulled in by default. # the main package. This however makes it pulled in by default.
@ -461,17 +474,31 @@ Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release}
# But we want them when packages BuildRequire python3-devel # But we want them when packages BuildRequire python3-devel
Requires: (python-rpm-macros if rpm-build) Requires: (python-rpm-macros if rpm-build)
Requires: (python3-rpm-macros if rpm-build) Requires: (python3-rpm-macros if rpm-build)
Requires: (pyproject-rpm-macros if rpm-build) # We omit this dependency on RHEL to avoid pulling the macros to AppStream:
# RHEL users can use the minimal implementation of %%pyproject_buildrequires
# from pyproject-srpm-macros instead.
# On Fedora, we keep this to avoid one additional round of %%generate_buildrequires.
%{!?rhel:Requires: (pyproject-rpm-macros if rpm-build)}
%unversioned_obsoletes_of_python3_X_if_main devel
%if %{with main_python}
# Python developers are very likely to need pip # Python developers are very likely to need pip
Recommends: %{pkgname}-pip Recommends: %{pkgname}-pip
%endif
# tox users are likely to need the devel subpackage
Supplements: tox
%if %{without bootstrap} %if %{without bootstrap}
Requires: (python3-rpm-generators if rpm-build) Requires: (python3-rpm-generators if rpm-build)
%endif %endif
Provides: %{pkgname}-2to3 = %{version}-%{release} Provides: %{pkgname}-2to3 = %{version}-%{release}
%if %{with main_python}
Provides: 2to3 = %{version}-%{release} Provides: 2to3 = %{version}-%{release}
%endif
Conflicts: %{pkgname} < %{version}-%{release} Conflicts: %{pkgname} < %{version}-%{release}
@ -489,12 +516,15 @@ Summary: A basic graphical development environment for Python
Requires: %{pkgname} = %{version}-%{release} Requires: %{pkgname} = %{version}-%{release}
Requires: %{pkgname}-tkinter = %{version}-%{release} Requires: %{pkgname}-tkinter = %{version}-%{release}
%unversioned_obsoletes_of_python3_X_if_main idle
%if %{with main_python}
Provides: idle3 = %{version}-%{release} Provides: idle3 = %{version}-%{release}
Provides: idle = %{version}-%{release} Provides: idle = %{version}-%{release}
%endif
Provides: %{pkgname}-tools = %{version}-%{release} Provides: %{pkgname}-tools = %{version}-%{release}
Provides: %{pkgname}-tools%{?_isa} = %{version}-%{release} Provides: %{pkgname}-tools%{?_isa} = %{version}-%{release}
Obsoletes: %{pkgname}-tools < %{version}-%{release}
%description -n %{pkgname}-idle %description -n %{pkgname}-idle
IDLE is Pythons Integrated Development and Learning Environment. IDLE is Pythons Integrated Development and Learning Environment.
@ -513,6 +543,8 @@ configuration, browsers, and other dialogs.
Summary: A GUI toolkit for Python Summary: A GUI toolkit for Python
Requires: %{pkgname} = %{version}-%{release} Requires: %{pkgname} = %{version}-%{release}
%unversioned_obsoletes_of_python3_X_if_main tkinter
# The importable module "turtle" is here, so provide python3-turtle. # The importable module "turtle" is here, so provide python3-turtle.
# (We don't provide python3-turtledemo, that's not too useful when imported.) # (We don't provide python3-turtledemo, that's not too useful when imported.)
%py_provides %{pkgname}-turtle %py_provides %{pkgname}-turtle
@ -527,6 +559,8 @@ Summary: The self-test suite for the main python3 package
Requires: %{pkgname} = %{version}-%{release} Requires: %{pkgname} = %{version}-%{release}
Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release} Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release}
%unversioned_obsoletes_of_python3_X_if_main test
%description -n %{pkgname}-test %description -n %{pkgname}-test
The self-test suite for the Python interpreter. The self-test suite for the Python interpreter.
@ -549,6 +583,8 @@ Requires: %{pkgname}-test%{?_isa} = %{version}-%{release}
Requires: %{pkgname}-tkinter%{?_isa} = %{version}-%{release} Requires: %{pkgname}-tkinter%{?_isa} = %{version}-%{release}
Requires: %{pkgname}-idle%{?_isa} = %{version}-%{release} Requires: %{pkgname}-idle%{?_isa} = %{version}-%{release}
%unversioned_obsoletes_of_python3_X_if_main debug
%description -n %{pkgname}-debug %description -n %{pkgname}-debug
python3-debug provides a version of the Python runtime with numerous debugging python3-debug provides a version of the Python runtime with numerous debugging
features enabled, aimed at advanced Python users such as developers of Python features enabled, aimed at advanced Python users such as developers of Python
@ -566,43 +602,6 @@ The debug runtime additionally supports debug builds of C-API extensions
(with the "d" ABI flag) for debugging issues in those extensions. (with the "d" ABI flag) for debugging issues in those extensions.
%endif # with debug_build %endif # with debug_build
%else # with flatpackage
# We'll not provide this, on purpose
# No package in Fedora shall ever depend on flatpackage via this
%global __requires_exclude ^python\\(abi\\) = 3\\..+
%global __provides_exclude ^python\\(abi\\) = 3\\..+
# Python interpreter packages used to be named (or provide) name pythonXY (e.g.
# python39). However, to align it with the executable names and to prepare for
# Python 3.10, they were renamed to pythonX.Y (e.g. python3.9, python3.10). We
# provide and obsolete the previous names.
# - Here are the tags for the flat package. For the nonflat package, the
# provide is repeated many lines above.
Provides: python%{pyshortver} = %{version}-%{release}
Obsoletes: python%{pyshortver} < %{version}-%{release}
%if %{with rpmwheels}
Requires: python-setuptools-wheel
Requires: python-pip-wheel
%else
Provides: bundled(python3dist(pip)) = %{pip_version}
Provides: bundled(python3dist(setuptools)) = %{setuptools_version}
%endif
# The zoneinfo module needs tzdata
Requires: tzdata
# The description for the flat package (SRPM and built)
%description
Python %{pybasever} package for developers.
This package exists to allow developers to test their code against a newer
version of Python. This is not a full Python stack and if you wish to run
your applications with Python %{pybasever}, update your Fedora to a newer
version once Python %{pybasever} is stable.
%endif # with flatpackage
# ====================================================== # ======================================================
# The prep phase of the build: # The prep phase of the build:
@ -717,7 +716,7 @@ BuildPython() {
--with-ssl-default-suites=openssl \ --with-ssl-default-suites=openssl \
--without-static-libpython \ --without-static-libpython \
%if %{with rpmwheels} %if %{with rpmwheels}
--with-wheel-pkg-dir=%{_datadir}/python-wheels \ --with-wheel-pkg-dir=%{python_wheel_dir} \
%endif %endif
%if %{with valgrind} %if %{with valgrind}
--with-valgrind \ --with-valgrind \
@ -942,15 +941,25 @@ find . -name "*~" -exec rm -f {} \;
# Python CMD line options: # Python CMD line options:
# -s - don't add user site directory to sys.path # -s - don't add user site directory to sys.path
# -B - don't write .pyc files on import # -B - don't write .pyc files on import
# Clamp the source mtime first, see https://fedoraproject.org/wiki/Changes/ReproducibleBuildsClampMtimes
# The clamp_source_mtime module is only guaranteed to exist on Fedoras that enabled this option:
%if 0%{?clamp_mtime_to_source_date_epoch}
LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
PYTHONPATH="%{_rpmconfigdir}/redhat" \
%{buildroot}%{_bindir}/python%{pybasever} -s -B -m clamp_source_mtime %{buildroot}%{pylibdir}
%endif
# compileall CMD line options: # compileall CMD line options:
# -f - force rebuild even if timestamps are up to date # -f - force rebuild even if timestamps are up to date
# -o - optimization levels to run compilation with # -o - optimization levels to run compilation with
# -s - part of path to left-strip from path to source file (buildroot) # -s - part of path to left-strip from path to source file (buildroot)
# -p - path to add as prefix to path to source file (/ to make it absolute) # -p - path to add as prefix to path to source file (/ to make it absolute)
# --hardlink-dupes - hardlink different optimization level pycs together if identical (saves space) # --hardlink-dupes - hardlink different optimization level pycs together if identical (saves space)
# --invalidation-mode - we prefer the timestamp invalidation mode for performance reasons
# -x - skip test modules with SyntaxErrors (taken from the Makefile)
LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \ LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
%{buildroot}%{_bindir}/python%{pybasever} -s -B -m compileall \ %{buildroot}%{_bindir}/python%{pybasever} -s -B -m compileall \
-f %{_smp_mflags} -o 0 -o 1 -o 2 -s %{buildroot} -p / %{buildroot} --hardlink-dupes || : -f %{_smp_mflags} -o 0 -o 1 -o 2 -s %{buildroot} -p / %{buildroot} --hardlink-dupes --invalidation-mode=timestamp \
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data'
# Turn this BRP off, it is done by compileall2 --hardlink-dupes above # Turn this BRP off, it is done by compileall2 --hardlink-dupes above
%global __brp_python_hardlink %{nil} %global __brp_python_hardlink %{nil}
@ -1066,15 +1075,13 @@ CheckPython() {
# test_distutils # test_distutils
# distutils.tests.test_bdist_rpm tests fail when bootstraping the Python # distutils.tests.test_bdist_rpm tests fail when bootstraping the Python
# package: rpmbuild requires /usr/bin/pythonX.Y to be installed # package: rpmbuild requires /usr/bin/pythonX.Y to be installed
# test_sundry and test_name_error_suggestions_do_not_trigger_for_too_many_locals fail with Python 3.11.0a1. # test_freeze_simple_script is skipped, because it fails when bundled wheels
# Fixes should be included in 2nd alpha. # are removed in Fedora.
# https://bugs.python.org/issue45400 # upstream report: https://bugs.python.org/issue45783
# https://bugs.python.org/issue45402
LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \
-wW --slowest -j0 --timeout=1800 \ -wW --slowest -j0 --timeout=1800 \
-i test_sundry \ -i test_freeze_simple_script \
-i test_name_error_suggestions_do_not_trigger_for_too_many_locals \
%if %{with bootstrap} %if %{with bootstrap}
-x test_distutils \ -x test_distutils \
%endif %endif
@ -1113,17 +1120,13 @@ CheckPython optimized
%if %{with main_python} %if %{with main_python}
%if %{without flatpackage}
%files -n python-unversioned-command %files -n python-unversioned-command
%endif
%{_bindir}/python %{_bindir}/python
%{_mandir}/*/python.1* %{_mandir}/*/python.1*
%endif %endif
%if %{without flatpackage}
%files -n %{pkgname}-libs %files -n %{pkgname}-libs
%doc README.rst %doc README.rst
%endif
%dir %{pylibdir} %dir %{pylibdir}
%dir %{dynload_dir} %dir %{dynload_dir}
@ -1131,9 +1134,7 @@ CheckPython optimized
%license %{pylibdir}/LICENSE.txt %license %{pylibdir}/LICENSE.txt
%{pylibdir}/lib2to3 %{pylibdir}/lib2to3
%if %{without flatpackage}
%exclude %{pylibdir}/lib2to3/tests %exclude %{pylibdir}/lib2to3/tests
%endif
%dir %{pylibdir}/unittest/ %dir %{pylibdir}/unittest/
%dir %{pylibdir}/unittest/__pycache__/ %dir %{pylibdir}/unittest/__pycache__/
@ -1255,6 +1256,12 @@ CheckPython optimized
%dir %{pylibdir}/site-packages/ %dir %{pylibdir}/site-packages/
%dir %{pylibdir}/site-packages/__pycache__/ %dir %{pylibdir}/site-packages/__pycache__/
%{pylibdir}/site-packages/README.txt %{pylibdir}/site-packages/README.txt
%if %{with debug_build}
%exclude %{pylibdir}/_sysconfigdata_%{ABIFLAGS_debug}_linux_%{platform_triplet}.py
%exclude %{pylibdir}/__pycache__/_sysconfigdata_%{ABIFLAGS_debug}_linux_%{platform_triplet}%{bytecode_suffixes}
%endif
%{pylibdir}/*.py %{pylibdir}/*.py
%dir %{pylibdir}/__pycache__/ %dir %{pylibdir}/__pycache__/
%{pylibdir}/__pycache__/*%{bytecode_suffixes} %{pylibdir}/__pycache__/*%{bytecode_suffixes}
@ -1306,6 +1313,11 @@ CheckPython optimized
%{pylibdir}/importlib/metadata/*.py %{pylibdir}/importlib/metadata/*.py
%{pylibdir}/importlib/metadata/__pycache__/*%{bytecode_suffixes} %{pylibdir}/importlib/metadata/__pycache__/*%{bytecode_suffixes}
%dir %{pylibdir}/importlib/resources/
%dir %{pylibdir}/importlib/resources/__pycache__/
%{pylibdir}/importlib/resources/*.py
%{pylibdir}/importlib/resources/__pycache__/*%{bytecode_suffixes}
%dir %{pylibdir}/json/ %dir %{pylibdir}/json/
%dir %{pylibdir}/json/__pycache__/ %dir %{pylibdir}/json/__pycache__/
%{pylibdir}/json/*.py %{pylibdir}/json/*.py
@ -1314,15 +1326,20 @@ CheckPython optimized
%{pylibdir}/logging %{pylibdir}/logging
%{pylibdir}/multiprocessing %{pylibdir}/multiprocessing
%dir %{pylibdir}/re/
%{pylibdir}/re/*.py
%{pylibdir}/re/__pycache__/*%{bytecode_suffixes}
%dir %{pylibdir}/sqlite3/ %dir %{pylibdir}/sqlite3/
%dir %{pylibdir}/sqlite3/__pycache__/ %dir %{pylibdir}/sqlite3/__pycache__/
%{pylibdir}/sqlite3/*.py %{pylibdir}/sqlite3/*.py
%{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes} %{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes}
%if %{without flatpackage} %dir %{pylibdir}/tomllib/
%{pylibdir}/tomllib/*.py
%{pylibdir}/tomllib/__pycache__/*%{bytecode_suffixes}
%exclude %{pylibdir}/turtle.py %exclude %{pylibdir}/turtle.py
%exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} %exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes}
%endif
%{pylibdir}/urllib %{pylibdir}/urllib
%{pylibdir}/xml %{pylibdir}/xml
@ -1353,15 +1370,10 @@ CheckPython optimized
%endif %endif
%if %{without flatpackage}
%files -n %{pkgname}-devel %files -n %{pkgname}-devel
%endif
%{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/* %{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/*
%if %{without flatpackage}
%exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/Makefile %exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/Makefile
%exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} %exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h}
%endif
%{_includedir}/python%{LDVERSION_optimized}/*.h %{_includedir}/python%{LDVERSION_optimized}/*.h
%{_includedir}/python%{LDVERSION_optimized}/internal/ %{_includedir}/python%{LDVERSION_optimized}/internal/
%{_includedir}/python%{LDVERSION_optimized}/cpython/ %{_includedir}/python%{LDVERSION_optimized}/cpython/
@ -1396,10 +1408,7 @@ CheckPython optimized
%{_libdir}/pkgconfig/python-%{pybasever}-embed.pc %{_libdir}/pkgconfig/python-%{pybasever}-embed.pc
%if %{without flatpackage}
%files -n %{pkgname}-idle %files -n %{pkgname}-idle
%endif
%if %{with main_python} %if %{with main_python}
%{_bindir}/idle* %{_bindir}/idle*
%else %else
@ -1414,14 +1423,9 @@ CheckPython optimized
%{_datadir}/icons/hicolor/*/apps/idle3.* %{_datadir}/icons/hicolor/*/apps/idle3.*
%endif %endif
%if %{without flatpackage}
%files -n %{pkgname}-tkinter %files -n %{pkgname}-tkinter
%endif
%{pylibdir}/tkinter %{pylibdir}/tkinter
%if %{without flatpackage}
%exclude %{pylibdir}/tkinter/test %exclude %{pylibdir}/tkinter/test
%endif
%{dynload_dir}/_tkinter.%{SOABI_optimized}.so %{dynload_dir}/_tkinter.%{SOABI_optimized}.so
%{pylibdir}/turtle.py %{pylibdir}/turtle.py
%{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes}
@ -1432,17 +1436,14 @@ CheckPython optimized
%{pylibdir}/turtledemo/__pycache__/*%{bytecode_suffixes} %{pylibdir}/turtledemo/__pycache__/*%{bytecode_suffixes}
%if %{without flatpackage}
%files -n %{pkgname}-test %files -n %{pkgname}-test
%endif
%{pylibdir}/ctypes/test %{pylibdir}/ctypes/test
%{pylibdir}/distutils/tests %{pylibdir}/distutils/tests
%{pylibdir}/sqlite3/test
%{pylibdir}/test %{pylibdir}/test
%{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so %{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so
%{dynload_dir}/_testbuffer.%{SOABI_optimized}.so %{dynload_dir}/_testbuffer.%{SOABI_optimized}.so
%{dynload_dir}/_testcapi.%{SOABI_optimized}.so %{dynload_dir}/_testcapi.%{SOABI_optimized}.so
%{dynload_dir}/_testclinic.%{SOABI_optimized}.so
%{dynload_dir}/_testimportmultiple.%{SOABI_optimized}.so %{dynload_dir}/_testimportmultiple.%{SOABI_optimized}.so
%{dynload_dir}/_testinternalcapi.%{SOABI_optimized}.so %{dynload_dir}/_testinternalcapi.%{SOABI_optimized}.so
%{dynload_dir}/_testmultiphase.%{SOABI_optimized}.so %{dynload_dir}/_testmultiphase.%{SOABI_optimized}.so
@ -1458,10 +1459,7 @@ CheckPython optimized
# all of the other subpackages # all of the other subpackages
%if %{with debug_build} %if %{with debug_build}
%if %{without flatpackage}
%files -n %{pkgname}-debug %files -n %{pkgname}-debug
%endif
%if %{with main_python} %if %{with main_python}
%{_bindir}/python3-debug %{_bindir}/python3-debug
%{_bindir}/python-debug %{_bindir}/python-debug
@ -1574,10 +1572,14 @@ CheckPython optimized
%{dynload_dir}/_ctypes_test.%{SOABI_debug}.so %{dynload_dir}/_ctypes_test.%{SOABI_debug}.so
%{dynload_dir}/_testbuffer.%{SOABI_debug}.so %{dynload_dir}/_testbuffer.%{SOABI_debug}.so
%{dynload_dir}/_testcapi.%{SOABI_debug}.so %{dynload_dir}/_testcapi.%{SOABI_debug}.so
%{dynload_dir}/_testclinic.%{SOABI_debug}.so
%{dynload_dir}/_testimportmultiple.%{SOABI_debug}.so %{dynload_dir}/_testimportmultiple.%{SOABI_debug}.so
%{dynload_dir}/_testinternalcapi.%{SOABI_debug}.so %{dynload_dir}/_testinternalcapi.%{SOABI_debug}.so
%{dynload_dir}/_testmultiphase.%{SOABI_debug}.so %{dynload_dir}/_testmultiphase.%{SOABI_debug}.so
%{pylibdir}/_sysconfigdata_%{ABIFLAGS_debug}_linux_%{platform_triplet}.py
%{pylibdir}/__pycache__/_sysconfigdata_%{ABIFLAGS_debug}_linux_%{platform_triplet}%{bytecode_suffixes}
%endif # with debug_build %endif # with debug_build
# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from ldconfig # We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from ldconfig
@ -1601,5 +1603,134 @@ CheckPython optimized
# ====================================================== # ======================================================
%changelog %changelog
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 3.11.4-2
- Rebuilt for Python 3.12
* Wed Jun 07 2023 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.4-1
- Update to 3.11.4
* Wed May 24 2023 Lumír Balhar <lbalhar@redhat.com> - 3.11.3-2
- Fix for CVE-2023-24329
* Wed Apr 05 2023 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.3-1
- Update to 3.11.3
* Wed Feb 08 2023 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.2-1
- Update to 3.11.2
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.11.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jan 06 2023 Miro Hrončok <mhroncok@redhat.com> - 3.11.1-3
- Fix `asyncio` subprocess losing `stderr` and `stdout` output
- Remove any deprecation warnings in asyncio.get_event_loop()
* Mon Dec 19 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.1-2
- No longer patch the default bytecode cache invalidation policy
* Wed Dec 07 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.1-1
- Update to 3.11.1
* Mon Oct 24 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0-1
- Update to 3.11.0
* Tue Sep 13 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~rc2-1
- Update to 3.11.0rc2
* Tue Aug 09 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~rc1-2
- Don't use custom installation schemes
- Fixes rhbz#2026979
- Fixes rhbz#2097183
* Mon Aug 08 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~rc1-1
- Update to 3.11.0rc1
* Tue Jul 26 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~b5-1
- Update to 3.11.0b5
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.11.0~b4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jul 11 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~b4-1
- Update to 3.11.0b4
* Fri Jul 08 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~b3-8
- Finish bootstrap of the re module speed regression fix
* Fri Jul 08 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~b3-7
- Fix speed regression in the re module which prevented chromium from building
* Fri Jun 24 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~b3-6
- Clear and reset sqlite3 statements properly in cursor iternext (fixes rhbz#2099049)
- Revert a problematic fix of threading._shutdown() again (fixes rhbz#2100282)
* Tue Jun 21 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~b3-5
- Build Python with the optimized Blake2 library libb2
* Tue Jun 21 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~b3-4
- Make C++ version of _Py_CAST work with 0/NULL
* Mon Jun 13 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~b3-3
- Finish bootstrapping for Python 3.11 mass rebuild
* Mon Jun 13 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~b3-2
- Initial bootstrap for Python 3.11 mass rebuild
* Wed Jun 01 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~b3-1
- Update to 3.11.0b3
* Tue May 31 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~b2-1
- Update to 3.11.0b2
* Tue May 10 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~b1-2
- Finish bootstrapping 3.11.0b1
* Sun May 08 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~b1-1
- Update to 3.11.0b1
* Wed Apr 20 2022 Tomas Orsava <torsava@redhat.com> - 3.11.0~a7-3
- Build Python 3.11 with subpackages
- `python(abi)` is still not Provided for alternative Python versions
- Drop old no-longer-needed Obsoletes of python311 and python3-tools
- Move _sysconfigdata_d_linux*.py to the debug subpackage
- Resolves: rhbz#2063227
* Thu Apr 07 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a7-2
- Finish bootstrapping 3.11.0a7
* Wed Apr 06 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a7-1
- Update to 3.11.0a7
* Tue Mar 08 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~a6-2
- Finish bootstrapping 3.11.0a6
* Mon Mar 07 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~a6-1
- Update to 3.11.0a6
* Fri Feb 04 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a5-1
- Update to 3.11.0a5
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.11.0~a4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Mon Jan 17 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a4-1
- Update to 3.11.0a4
* Sat Jan 08 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~a3-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/LIBFFI34
* Mon Dec 13 2021 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~a3-2
- Supplement tox
* Fri Dec 10 2021 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a3-1
- Update to 3.11.0a3
* Mon Nov 15 2021 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a2-1
- Update to 3.11.0a2
- Patch 251 was updated to include specific install scheme for virtualenv
* Fri Nov 12 2021 Björn Esser <besser82@fedoraproject.org> - 3.11.0~a1-2
- Rebuild(libnsl2)
* Wed Oct 06 2021 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a1-1 * Wed Oct 06 2021 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a1-1
- Initial Python 3.11 package forked from Python 3.10 - Initial Python 3.11 package forked from Python 3.10

View File

@ -6,8 +6,17 @@ xml:
# exclude _socket from ipv4 only functions check, it has both ipv4 and ipv6 only # exclude _socket from ipv4 only functions check, it has both ipv4 and ipv6 only
badfuncs: badfuncs:
allowed:
/usr/lib*/python*/lib-dynload/_socket.*:
- inet_aton
- inet_ntoa
# exclude the debug build from annocheck entirely
annocheck:
ignore: ignore:
- /usr/lib*/python*/lib-dynload/_socket.* - /usr/bin/python*d
- /usr/lib*/libpython*d.so.1.0
- /usr/lib*/python*/lib-dynload/*.cpython-*d-*-*-*.so
# don't report changed content of compiled files # don't report changed content of compiled files
# that is expected with every toolchain update and not reproducible yet # that is expected with every toolchain update and not reproducible yet

106
rpmlint.toml Normal file
View File

@ -0,0 +1,106 @@
Filters = [
# KNOWN BUGS:
# https://bugzilla.redhat.com/show_bug.cgi?id=1489816
'crypto-policy-non-compliance-openssl',
# TESTS:
'(zero-length|pem-certificate|uncompressed-zip) /usr/lib(64)?/python3\.\d+/test',
# OTHER DELIBERATES:
# chroot function
'missing-call-to-chdir-with-chroot',
# gethostbyname function calls gethostbyname
'(E|W): binary-or-shlib-calls-gethostbyname /usr/lib(64)?/python3\.\d+/lib-dynload/_socket\.',
# intentionally unversioned and selfobsoleted
'unversioned-explicit-obsoletes python',
'unversioned Obsoletes: Obsoletes: python3\.\d+$',
'self-obsoletion python3\.\d+(-\S+)? obsoletes python3\.\d+(-\S+)?',
# intentionally hardcoded
'hardcoded-library-path in %{_prefix}/lib/(debug/%{_libdir}|python%{pybasever})',
# we have non binary stuff, python files
'only-non-binary-in-usr-lib',
# some devel files that are deliberately needed
'devel-file-in-non-devel-package /usr/include/python3\.\d+m?/pyconfig-(32|64)\.h',
'devel-file-in-non-devel-package /usr/lib(64)?/python3\.\d+/distutils/tests/xxmodule\.c',
# ...or are used as test data
'devel-file-in-non-devel-package /usr/lib(64)?/python3\.\d+/test',
# some bytecode is shipped without sources on purpose, as a space optimization
# if this regex needs to be relaxed in the future, make sure it **does not** match pyc files in __pycache__
'python-bytecode-without-source /usr/lib(64)?/python3\.\d+/(encodings|pydoc_data)/[^/]+.pyc',
# DUPLICATE FILES
# test data are often duplicated
'(E|W): files-duplicate /usr/lib(64)?/python3\.\d+/(test|__phello__)/',
# duplicated inits or mains are also common
'(E|W): files-duplicate .+__init__\.py.+__init__\.py',
'(E|W): files-duplicate .+__main__\.py.+__main__\.py',
# files in the debugsource package
'(E|W): files-duplicate /usr/src/debug',
# general waste report
'(E|W): files-duplicated-waste',
# SORRY, NOT SORRY:
# manual pages
'no-manual-page-for-binary (idle|pydoc|pyvenv|2to3|python3?-debug|pathfix|msgfmt|pygettext)',
'no-manual-page-for-binary python3?.*-config$',
'no-manual-page-for-binary python3\.\d+dm?$',
# missing documentation from subpackages
'^python3(\.\d+)?-(debug|tkinter|test|idle)\.[^:]+: (E|W): no-documentation',
# platform python is obsoleted, but not provided
'obsolete-not-provided platform-python',
# we have extra tokens at the end of %endif/%else directives, we consider them useful
'extra tokens at the end of %(endif|else) directive',
# RPMLINT IMPERFECTIONS
# https://github.com/rpm-software-management/rpmlint/issues/780
'/usr/lib/debug',
# we provide python(abi) manually to be sure. createrepo will merge this with the automatic
'python3(\.\d+)?\.[^:-]+: (E|W): useless-provides python\(abi\)',
# debugsource and debuginfo have no docs
'^python3(\.\d+)?-debug(source|info)\.[^:]+: (E|W): no-documentation',
# this is OK for F28+
'library-without-ldconfig-post',
# debug package contains devel and non-devel files
'python3(\.\d+)?-debug\.[^:]+: (E|W): (non-)?devel-file-in-(non-)?devel-package',
# this goes to other subpackage, hence not actually dangling
'dangling-relative-symlink /usr/bin/python python3',
'dangling-relative-symlink /usr/share/man/man1/python\.1\.gz python3\.1\.gz',
'dangling-relative-symlink /usr/lib(64)?/pkgconfig/python-3\.\d+dm?(-embed)?\.pc python-3\.\d+(-embed)?\.pc',
# the python-unversioned-command package contains dangling symlinks by design
'^python-unversioned-command\.[^:]+: (E|W): dangling-relative-symlink (/usr/bin/python \./python3|/usr/share/man/man1/python\.1\S* ./python3\.1\S*)$',
# we need this macro to evaluate, even if the line starts with #
'macro-in-comment %\{_pyconfig(32|64)_h\}',
# Python modules don't need to be linked against libc
# Since 3.8 they are no longer linked against libpython3.8.so.1.0
'(E|W): library-not-linked-against-libc /usr/lib(64)?/python3\.\d+/lib-dynload/',
'(E|W): shared-lib(rary)?-without-dependency-information /usr/lib(64)?/python3\.\d+/lib-dynload/',
# specfile-errors are listed twice, once with reason and once without
# we filter out the empty ones
'\bpython3(\.\d+)?\.(src|spec): (E|W): specfile-error\s+$',
# SPELLING ERRORS
'spelling-error .* en_US (bytecode|pyc|filename|tkinter|namespaces|pytest) ',
]

View File

@ -1,2 +1,2 @@
SHA512 (Python-3.11.0a1.tar.xz) = 3705fa3d05fccd491fba981c9495d5b36793f284a39b267a5ff7b25c7f08de84bbd5afe200296cedd1cc55f495fd3efc55d7b34910e1be1a785ce5772b857d7a SHA512 (Python-3.11.4.tar.xz) = 7eb14fecbf60824d10c22a9057584c3a142c2866f4af6caa2525c10c8bcb24e6e7afb32a44a0e118df0a2b2543d578c3b422ffd4a5fa317dfe6ea371cc7ee1ee
SHA512 (Python-3.11.0a1.tar.xz.asc) = b9d1542f215b5633835d21de0311d324c62e53b7afc525c00d26c863740fd01cc8c18a6ecb0a8ce8d38bf543cebdb64f0930f9201a8968dbbedf58fe9ad4c05c SHA512 (Python-3.11.4.tar.xz.asc) = 8ee82bf116b2cc7407e260eccf53e7fee4d7497165d0b9c3e59931c73f3b419bc0299b459eee9544a6e51e323ff0a6aa07827efd89f9c320b54556feeea04a78

View File

@ -15,25 +15,40 @@
repositories: repositories:
- repo: "https://src.fedoraproject.org/tests/python.git" - repo: "https://src.fedoraproject.org/tests/python.git"
dest: "python" dest: "python"
pybasever: "3.11"
tests: tests:
- rpm_qa: - rpm_qa:
run: rpm -qa run: rpm -qa
- smoke: - smoke:
dir: python/smoke dir: python/smoke
run: VERSION=3.11 ./venv.sh run: "VERSION={{ pybasever }} ./venv.sh"
- smoke_virtualenv: - smoke_virtualenv:
dir: python/smoke dir: python/smoke
run: VERSION=3.11 METHOD=virtualenv ./venv.sh run: "VERSION={{ pybasever }} METHOD=virtualenv ./venv.sh"
- debugsmoke:
dir: python/smoke
run: "PYTHON=python{{ pybasever }}d TOX=false VERSION={{ pybasever }} ./venv.sh"
- selftest: - selftest:
dir: python/selftest dir: python/selftest
run: VERSION=3.11 X="" ./parallel.sh run: "VERSION={{ pybasever }} X='' ./parallel.sh"
- debugtest:
dir: python/selftest
run: "VERSION={{ pybasever }} PYTHON=python{{ pybasever }}d X='' ./parallel.sh"
- debugflags:
dir: python/flags
run: "python{{ pybasever }}d ./assertflags.py -O0"
- marshalparser: - marshalparser:
dir: python/marshalparser dir: python/marshalparser
run: VERSION=3.11 SAMPLE=10 test_marshalparser_compatibility.sh run: "VERSION={{ pybasever }} SAMPLE=10 test_marshalparser_compatibility.sh"
required_packages: required_packages:
- gcc # for extension building in venv and selftest - gcc # for extension building in venv and selftest
- gcc-c++ # for test_cppext
- gdb # for test_gdb - gdb # for test_gdb
- python3.11 # the test subject - "python{{ pybasever }}" # the test subject
- "python{{ pybasever }}-debug" # for leak testing
- "python{{ pybasever }}-devel" # for extension building in venv and selftest
- "python{{ pybasever }}-tkinter" # for selftest
- "python{{ pybasever }}-test" # for selftest
- tox # for venv tests - tox # for venv tests
- virtualenv # for virtualenv tests - virtualenv # for virtualenv tests
- glibc-all-langpacks # for locale tests - glibc-all-langpacks # for locale tests