diff --git a/build-with-cython3.patch b/build-with-cython3.patch new file mode 100644 index 0000000..d0ab151 --- /dev/null +++ b/build-with-cython3.patch @@ -0,0 +1,17 @@ +Index: PyYAML-6.0.1/setup.py +=================================================================== +--- PyYAML-6.0.1.orig/setup.py ++++ PyYAML-6.0.1/setup.py +@@ -82,7 +82,11 @@ if 'sdist' in sys.argv or os.environ.get + with_cython = True + try: + from Cython.Distutils.extension import Extension as _Extension +- from Cython.Distutils import build_ext as _build_ext ++ try: ++ # try old_build_ext from Cython > 3 first, until we can dump it entirely ++ from Cython.Distutils.old_build_ext import old_build_ext as _build_ext ++ except ImportError: ++ from Cython.Distutils import build_ext as _build_ext + with_cython = True + except ImportError: + if with_cython: diff --git a/python-PyYAML.changes b/python-PyYAML.changes index 82e5707..6151804 100644 --- a/python-PyYAML.changes +++ b/python-PyYAML.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jul 1 10:52:46 UTC 2024 - Dirk Müller + +- add build-with-cython3.patch from 6.0.2rc1 to build with + cython3 (needed for python 3.13+) + ------------------------------------------------------------------- Mon Feb 26 03:18:33 UTC 2024 - Steve Kowalik diff --git a/python-PyYAML.spec b/python-PyYAML.spec index 8071788..7b2f3cf 100644 --- a/python-PyYAML.spec +++ b/python-PyYAML.spec @@ -24,7 +24,8 @@ Summary: YAML parser and emitter for Python License: MIT URL: https://github.com/yaml/pyyaml Source: https://files.pythonhosted.org/packages/source/P/PyYAML/PyYAML-%{version}.tar.gz -BuildRequires: %{python_module Cython with %python-Cython < 3} +Patch1: build-with-cython3.patch +BuildRequires: %{python_module Cython} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} @@ -51,6 +52,7 @@ configuration files to object serialization and persistance. %build export CFLAGS="%{optflags}" +export PYYAML_FORCE_CYTHON=1 %pyproject_wheel # Fix example permissions. find examples/ -type f | xargs chmod a-x