Compare commits
10 Commits
2d8f888430
...
8b902d984a
Author | SHA1 | Date |
---|---|---|
David Abdurachmanov | 8b902d984a | |
Yaakov Selkowitz | 261b6e48d6 | |
Miro Hrončok | 187d5c28b8 | |
Miro Hrončok | fb0049bb7a | |
Tomáš Hrnčiar | 614cafc400 | |
Tomáš Hrnčiar | 67ba754f51 | |
Tomáš Hrnčiar | 0483fca31a | |
Charalampos Stratakis | 1f830e372b | |
Fedora Release Engineering | 88668cf1f4 | |
Miro Hrončok | bc99d88db7 |
|
@ -1,126 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Snow <ericsnowcurrently@gmail.com>
|
||||
Date: Wed, 21 Jun 2023 09:51:01 +0200
|
||||
Subject: [PATCH] 00402: Add PyType_GetDict()
|
||||
|
||||
This patch should make pyqt6 build with Python 3.12.
|
||||
For more info see: https://github.com/python/cpython/pull/105747
|
||||
---
|
||||
Doc/c-api/type.rst | 16 ++++++++++++++++
|
||||
Doc/c-api/typeobj.rst | 17 +++++++++++++++--
|
||||
Include/cpython/object.h | 1 +
|
||||
...23-06-13-14-24-55.gh-issue-105227.HDL9aF.rst | 5 +++++
|
||||
Objects/typeobject.c | 7 +++++++
|
||||
5 files changed, 44 insertions(+), 2 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/C API/2023-06-13-14-24-55.gh-issue-105227.HDL9aF.rst
|
||||
|
||||
diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst
|
||||
index c99c7ef93a..8f883f5299 100644
|
||||
--- a/Doc/c-api/type.rst
|
||||
+++ b/Doc/c-api/type.rst
|
||||
@@ -50,6 +50,22 @@ Type Objects
|
||||
The return type is now ``unsigned long`` rather than ``long``.
|
||||
|
||||
|
||||
+.. c:function:: PyObject* PyType_GetDict(PyTypeObject* type)
|
||||
+
|
||||
+ Return the type object's internal namespace, which is otherwise only
|
||||
+ exposed via a read-only proxy (``cls.__dict__``). This is a
|
||||
+ replacement for accessing :c:member:`~PyTypeObject.tp_dict` directly.
|
||||
+ The returned dictionary must be treated as read-only.
|
||||
+
|
||||
+ This function isn't intended for general use. It's meant for
|
||||
+ specific embedding and language-binding cases, where direct access
|
||||
+ to the dict is necessary and indirect access (e.g. via the proxy)
|
||||
+ isn't adequate. Extension modules may continue to use ``tp_dict``,
|
||||
+ directly or indirectly, when setting up their own types.
|
||||
+
|
||||
+ .. versionadded:: 3.12
|
||||
+
|
||||
+
|
||||
.. c:function:: void PyType_Modified(PyTypeObject *type)
|
||||
|
||||
Invalidate the internal lookup cache for the type and all of its
|
||||
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
|
||||
index c6e783acdf..46015bc108 100644
|
||||
--- a/Doc/c-api/typeobj.rst
|
||||
+++ b/Doc/c-api/typeobj.rst
|
||||
@@ -110,7 +110,7 @@ Quick Reference
|
||||
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
|
||||
| :c:member:`~PyTypeObject.tp_base` | :c:type:`PyTypeObject` * | __base__ | | | X | |
|
||||
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
|
||||
- | :c:member:`~PyTypeObject.tp_dict` | :c:type:`PyObject` * | __dict__ | | | ? | |
|
||||
+ | <<:c:member:`~PyTypeObject.tp_dict`>> | :c:type:`PyObject` * | __dict__ | | | ? | |
|
||||
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
|
||||
| :c:member:`~PyTypeObject.tp_descr_get` | :c:type:`descrgetfunc` | __get__ | | | | X |
|
||||
+------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+
|
||||
@@ -157,6 +157,9 @@ Quick Reference
|
||||
**<>**: Names in angle brackets should be initially set to ``NULL`` and
|
||||
treated as read-only.
|
||||
|
||||
+ **<<>>**: Names in double angle brackets should be initially set to
|
||||
+ ``NULL`` and treated as read-only after initialization.
|
||||
+
|
||||
**[]**: Names in square brackets are for internal use only.
|
||||
|
||||
**<R>** (as a prefix) means the field is required (must be non-``NULL``).
|
||||
@@ -1717,7 +1720,17 @@ and :c:type:`PyType_Type` effectively act as defaults.)
|
||||
called; it may also be initialized to a dictionary containing initial attributes
|
||||
for the type. Once :c:func:`PyType_Ready` has initialized the type, extra
|
||||
attributes for the type may be added to this dictionary only if they don't
|
||||
- correspond to overloaded operations (like :meth:`__add__`).
|
||||
+ correspond to overloaded operations (like :meth:`__add__`). Once
|
||||
+ initialization for the type has finished, this field should be
|
||||
+ treated as read-only.
|
||||
+
|
||||
+ .. versionchanged:: 3.12
|
||||
+
|
||||
+ Internals detail: For the static builtin types this is always ``NULL``.
|
||||
+ Instead, the dict for each is stored on ``PyInterpreterState``.
|
||||
+ If needed, use :c:func:`PyType_GetDict` to get the corresponding
|
||||
+ dict for those types. This is not normally necessary,
|
||||
+ and certainly not for user-defined type objects.
|
||||
|
||||
**Inheritance:**
|
||||
|
||||
diff --git a/Include/cpython/object.h b/Include/cpython/object.h
|
||||
index d8eff69103..c5d0851a4b 100644
|
||||
--- a/Include/cpython/object.h
|
||||
+++ b/Include/cpython/object.h
|
||||
@@ -283,6 +283,7 @@ PyAPI_FUNC(PyTypeObject *) _PyType_CalculateMetaclass(PyTypeObject *, PyObject *
|
||||
PyAPI_FUNC(PyObject *) _PyType_GetDocFromInternalDoc(const char *, const char *);
|
||||
PyAPI_FUNC(PyObject *) _PyType_GetTextSignatureFromInternalDoc(const char *, const char *);
|
||||
PyAPI_FUNC(PyObject *) PyType_GetModuleByDef(PyTypeObject *, PyModuleDef *);
|
||||
+PyAPI_FUNC(PyObject *) PyType_GetDict(PyTypeObject *);
|
||||
|
||||
PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int);
|
||||
PyAPI_FUNC(void) _Py_BreakPoint(void);
|
||||
diff --git a/Misc/NEWS.d/next/C API/2023-06-13-14-24-55.gh-issue-105227.HDL9aF.rst b/Misc/NEWS.d/next/C API/2023-06-13-14-24-55.gh-issue-105227.HDL9aF.rst
|
||||
new file mode 100644
|
||||
index 0000000000..6e0e5396f6
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/C API/2023-06-13-14-24-55.gh-issue-105227.HDL9aF.rst
|
||||
@@ -0,0 +1,5 @@
|
||||
+The new :c:func:`PyType_GetDict` provides the dictionary for the given type
|
||||
+object that is normally exposed by ``cls.__dict__``. Normally it's
|
||||
+sufficient to use :c:member:`~PyTypeObject.tp_dict`, but for the static
|
||||
+builtin types ``tp_dict`` is now always ``NULL``. ``PyType_GetDict()``
|
||||
+provides the correct dict object instead.
|
||||
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
|
||||
index bf33bde257..0deec50d63 100644
|
||||
--- a/Objects/typeobject.c
|
||||
+++ b/Objects/typeobject.c
|
||||
@@ -238,6 +238,13 @@ _PyType_GetDict(PyTypeObject *self)
|
||||
return lookup_tp_dict(self);
|
||||
}
|
||||
|
||||
+PyObject *
|
||||
+PyType_GetDict(PyTypeObject *self)
|
||||
+{
|
||||
+ PyObject *dict = lookup_tp_dict(self);
|
||||
+ return _Py_XNewRef(dict);
|
||||
+}
|
||||
+
|
||||
static inline void
|
||||
set_tp_dict(PyTypeObject *self, PyObject *dict)
|
||||
{
|
|
@ -14,10 +14,10 @@ URL: https://www.python.org/
|
|||
# WARNING When rebasing to a new Python version,
|
||||
# remember to update the python3-docs package as well
|
||||
%global general_version %{pybasever}.0
|
||||
%global prerel b3
|
||||
#global prerel ...
|
||||
%global upstream_version %{general_version}%{?prerel}
|
||||
Version: %{general_version}%{?prerel:~%{prerel}}
|
||||
Release: 2%{?dist}
|
||||
Release: 2.0.riscv64%{?dist}
|
||||
License: Python-2.0.1
|
||||
|
||||
|
||||
|
@ -71,7 +71,7 @@ License: Python-2.0.1
|
|||
# If the rpmwheels condition is disabled, we use the bundled wheel packages
|
||||
# from Python with the versions below.
|
||||
# This needs to be manually updated when we update Python.
|
||||
%global pip_version 23.1.2
|
||||
%global pip_version 23.2.1
|
||||
%global setuptools_version 67.6.1
|
||||
%global wheel_version 0.40.0
|
||||
# All of those also include a list of indirect bundled libs:
|
||||
|
@ -79,7 +79,7 @@ License: Python-2.0.1
|
|||
# $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt)
|
||||
%global pip_bundled_provides %{expand:
|
||||
Provides: bundled(python3dist(cachecontrol)) = 0.12.11
|
||||
Provides: bundled(python3dist(certifi)) = 2022.12.7
|
||||
Provides: bundled(python3dist(certifi)) = 2023.5.7
|
||||
Provides: bundled(python3dist(chardet)) = 5.1
|
||||
Provides: bundled(python3dist(colorama)) = 0.4.6
|
||||
Provides: bundled(python3dist(distlib)) = 0.3.6
|
||||
|
@ -87,19 +87,19 @@ Provides: bundled(python3dist(distro)) = 1.8
|
|||
Provides: bundled(python3dist(idna)) = 3.4
|
||||
Provides: bundled(python3dist(msgpack)) = 1.0.5
|
||||
Provides: bundled(python3dist(packaging)) = 21.3
|
||||
Provides: bundled(python3dist(platformdirs)) = 3.2
|
||||
Provides: bundled(python3dist(pygments)) = 2.14
|
||||
Provides: bundled(python3dist(pyparsing)) = 3.0.9
|
||||
Provides: bundled(python3dist(platformdirs)) = 3.8.1
|
||||
Provides: bundled(python3dist(pygments)) = 2.15.1
|
||||
Provides: bundled(python3dist(pyparsing)) = 3.1
|
||||
Provides: bundled(python3dist(pyproject-hooks)) = 1
|
||||
Provides: bundled(python3dist(requests)) = 2.28.2
|
||||
Provides: bundled(python3dist(requests)) = 2.31
|
||||
Provides: bundled(python3dist(resolvelib)) = 1.0.1
|
||||
Provides: bundled(python3dist(rich)) = 13.3.3
|
||||
Provides: bundled(python3dist(setuptools)) = 67.7.2
|
||||
Provides: bundled(python3dist(rich)) = 13.4.2
|
||||
Provides: bundled(python3dist(setuptools)) = 68
|
||||
Provides: bundled(python3dist(six)) = 1.16
|
||||
Provides: bundled(python3dist(tenacity)) = 8.2.2
|
||||
Provides: bundled(python3dist(tomli)) = 2.0.1
|
||||
Provides: bundled(python3dist(typing-extensions)) = 4.5
|
||||
Provides: bundled(python3dist(urllib3)) = 1.26.15
|
||||
Provides: bundled(python3dist(typing-extensions)) = 4.7.1
|
||||
Provides: bundled(python3dist(urllib3)) = 1.26.16
|
||||
Provides: bundled(python3dist(webencodings)) = 0.5.1
|
||||
}
|
||||
# setuptools
|
||||
|
@ -255,7 +255,9 @@ BuildRequires: glibc-devel
|
|||
BuildRequires: gmp-devel
|
||||
BuildRequires: gnupg2
|
||||
BuildRequires: libappstream-glib
|
||||
%if %{undefined rhel}
|
||||
BuildRequires: libb2-devel
|
||||
%endif
|
||||
BuildRequires: libffi-devel
|
||||
BuildRequires: libnsl2-devel
|
||||
BuildRequires: libtirpc-devel
|
||||
|
@ -362,13 +364,6 @@ Patch251: 00251-change-user-install-location.patch
|
|||
# https://github.com/GrahamDumpleton/mod_wsgi/issues/730
|
||||
Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch
|
||||
|
||||
# 00402 # ecae89d5edb8d253925dce12c3c56d1a6da198f3
|
||||
# Add PyType_GetDict()
|
||||
#
|
||||
# This patch should make pyqt6 build with Python 3.12.
|
||||
# For more info see: https://github.com/python/cpython/pull/105747
|
||||
Patch402: 00402-add-pytype_getdict.patch
|
||||
|
||||
# (New patches go here ^^^)
|
||||
#
|
||||
# When adding new patches to "python" and "python3" in Fedora, EL, etc.,
|
||||
|
@ -491,15 +486,21 @@ Summary: Python runtime libraries
|
|||
|
||||
%if %{with rpmwheels}
|
||||
Requires: %{python_wheel_pkg_prefix}-pip-wheel >= 23.1.2
|
||||
# Bundled libb2 is CC0, covered by grandfathering exception
|
||||
License: Python-2.0.1 AND CC0-1.0
|
||||
%else
|
||||
Provides: bundled(python3dist(pip)) = %{pip_version}
|
||||
%pip_bundled_provides
|
||||
# License manually combined form Python + pip
|
||||
License: Python-2.0.1 AND MIT AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LGPL-2.1-only AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause)
|
||||
License: Python-2.0.1 AND CC0-1.0 AND MIT AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LGPL-2.1-only AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause)
|
||||
%endif
|
||||
|
||||
%unversioned_obsoletes_of_python3_X_if_main libs
|
||||
|
||||
# Bundled internal headers are used even when building with system libb2
|
||||
# last updated by https://github.com/python/cpython/pull/6286
|
||||
Provides: bundled(libb2) = 0.98.1
|
||||
|
||||
# There are files in the standard library that have python shebang.
|
||||
# We've filtered the automatic requirement out so libs are installable without
|
||||
# the main package. This however makes it pulled in by default.
|
||||
|
@ -746,14 +747,15 @@ topdir=$(pwd)
|
|||
# Standard library built here will still use the %%build_...flags,
|
||||
# Fedora packages utilizing %%py3_build will use them as well
|
||||
# https://fedoraproject.org/wiki/Changes/Python_Extension_Flags
|
||||
export CFLAGS="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
|
||||
# https://fedoraproject.org/wiki/Changes/Python_Extension_Flags_Reduction
|
||||
export CFLAGS="%{extension_cflags}"
|
||||
export CFLAGS_NODIST="%{build_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
|
||||
export CXXFLAGS="%{extension_cxxflags} -D_GNU_SOURCE -fPIC -fwrapv"
|
||||
export CXXFLAGS="%{extension_cxxflags}"
|
||||
export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
|
||||
export OPT="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
|
||||
export OPT="%{extension_cflags}"
|
||||
export LINKCC="gcc"
|
||||
export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
|
||||
export LDFLAGS="%{extension_ldflags} -g $(pkg-config --libs-only-L openssl)"
|
||||
export LDFLAGS="%{extension_ldflags} $(pkg-config --libs-only-L openssl)"
|
||||
export LDFLAGS_NODIST="%{build_ldflags} -g $(pkg-config --libs-only-L openssl)"
|
||||
|
||||
# We can build several different configurations of Python: regular and debug.
|
||||
|
@ -1146,10 +1148,22 @@ CheckPython() {
|
|||
# test_freeze_simple_script is skipped, because it fails without bundled libs.
|
||||
# the freeze tool is only usable from the source checkout anyway,
|
||||
# we don't ship it in the RPM package.
|
||||
# test_check_probes is failing since it was introduced in 3.12.0rc1,
|
||||
# the test is skipped until it is fixed in upstream.
|
||||
# see: https://github.com/python/cpython/issues/104280#issuecomment-1669249980
|
||||
|
||||
LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \
|
||||
-wW --slowest %{_smp_mflags} --timeout=2700 \
|
||||
-wW --slowest %{_smp_mflags} \
|
||||
%ifnarch riscv64
|
||||
--timeout=2700 \
|
||||
%else
|
||||
--timeout=27000 \
|
||||
%endif
|
||||
-i test_freeze_simple_script \
|
||||
-i test_check_probes \
|
||||
%ifarch riscv64
|
||||
-x test_eintr \
|
||||
%endif
|
||||
%ifarch %{mips64}
|
||||
-x test_ctypes \
|
||||
%endif
|
||||
|
@ -1402,6 +1416,8 @@ CheckPython optimized
|
|||
%dir %{pylibdir}/zipfile/
|
||||
%{pylibdir}/zipfile/*.py
|
||||
%{pylibdir}/zipfile/__pycache__/*%{bytecode_suffixes}
|
||||
%{pylibdir}/zipfile/_path/*.py
|
||||
%{pylibdir}/zipfile/_path/__pycache__/*%{bytecode_suffixes}
|
||||
|
||||
%{pylibdir}/zoneinfo
|
||||
|
||||
|
@ -1658,6 +1674,35 @@ CheckPython optimized
|
|||
# ======================================================
|
||||
|
||||
%changelog
|
||||
* Fri Oct 13 2023 David Abdurachmanov <davidlt@rivosinc.com> - 3.12.0-2.0.riscv64
|
||||
- Increase tests timeout on riscv64 by 10x.
|
||||
- Disable test_eintr test on riscv64.
|
||||
|
||||
* Thu Oct 05 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 3.12.0-2
|
||||
- Use bundled libb2 in RHEL builds
|
||||
|
||||
* Mon Oct 02 2023 Miro Hrončok <mhroncok@redhat.com> - 3.12.0-1
|
||||
- Update to 3.12.0 final
|
||||
|
||||
* Tue Sep 19 2023 Miro Hrončok <mhroncok@redhat.com> - 3.12.0~rc3-1
|
||||
- Update to 3.12.0rc3
|
||||
|
||||
* Wed Sep 06 2023 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.12.0~rc2-1
|
||||
- Update to 3.12.0rc2
|
||||
|
||||
* Mon Aug 07 2023 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.12.0~rc1-1
|
||||
- Update to 3.12.0rc1
|
||||
|
||||
* Wed Aug 02 2023 Charalampos Stratakis <cstratak@redhat.com> - 3.12.0~b4-3
|
||||
- Remove extra distro-applied CFLAGS passed to user built C extensions
|
||||
- https://fedoraproject.org/wiki/Changes/Python_Extension_Flags_Reduction
|
||||
|
||||
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.0~b4-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
* Wed Jul 12 2023 Miro Hrončok <mhroncok@redhat.com> - 3.12.0~b4-1
|
||||
- Update to 3.12.0b4
|
||||
|
||||
* Wed Jun 21 2023 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.12.0~b3-2
|
||||
- Backport upstream patch to add PyType_GetDict() function
|
||||
|
||||
|
|
4
sources
4
sources
|
@ -1,2 +1,2 @@
|
|||
SHA512 (Python-3.12.0b3.tar.xz) = 2d83285ea09445da25204285937366b20793b12223f5a0979276633213773d14de6dbb6a311629b755962804d8521b30cf9fe032f447608b6df7af721a18ba0c
|
||||
SHA512 (Python-3.12.0b3.tar.xz.asc) = ab0d91f3c2fc001fe924f71182526d543a3c9e65238954bb954c58d03171a6cb3640a15570d2d7b889c6251fd876790121cd36bcc29a901f53d17f5f4f8f6f4e
|
||||
SHA512 (Python-3.12.0.tar.xz) = 4d5353151fd1dad80fe96bd2a668cec27287a0dad85086239597166f8189d4edf6c4800ed14f39c8e54816076fec13ba405d6bfa1123ad2dada8cf85c60025e6
|
||||
SHA512 (Python-3.12.0.tar.xz.asc) = 2c457f51cd4269deb2c644b35da1c617d1b1d53a6093da77b967f4e5661bc3400c70808aab4f619d9035fd33e656653f992d308c683e26f1505929a3a59b4ce2
|
||||
|
|
|
@ -30,10 +30,10 @@
|
|||
run: "PYTHON=python{{ pybasever }}d TOX=false VERSION={{ pybasever }} CYTHON=false ./venv.sh"
|
||||
- selftest:
|
||||
dir: python/selftest
|
||||
run: "VERSION={{ pybasever }} X='' ./parallel.sh"
|
||||
run: "VERSION={{ pybasever }} X='-i test_check_probes' ./parallel.sh"
|
||||
- debugtest:
|
||||
dir: python/selftest
|
||||
run: "VERSION={{ pybasever }} PYTHON=python{{ pybasever }}d X='' ./parallel.sh"
|
||||
run: "VERSION={{ pybasever }} PYTHON=python{{ pybasever }}d X='-i test_check_probes' ./parallel.sh"
|
||||
- debugflags:
|
||||
dir: python/flags
|
||||
run: "python{{ pybasever }}d ./assertflags.py -O0"
|
||||
|
|
Loading…
Reference in New Issue