Accepting request 1184287 from devel:languages:python

- add build-with-cython3.patch from 6.0.2rc1 to build with
  cython3 (needed for python 3.13+)

OBS-URL: https://build.opensuse.org/request/show/1184287
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-PyYAML?expand=0&rev=33
This commit is contained in:
Ana Guerrero 2024-07-02 16:14:43 +00:00 committed by Git OBS Bridge
commit 0236ff56e3
3 changed files with 26 additions and 1 deletions

17
build-with-cython3.patch Normal file
View File

@ -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:

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jul 1 10:52:46 UTC 2024 - Dirk Müller <dmueller@suse.com>
- 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 <steven.kowalik@suse.com>

View File

@ -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