From 2f44210f154149162c53ecbbd503de338debbe2a86e654087bf1d011ff0e42fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Thu, 3 Oct 2024 17:52:17 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main python-PyYAML revision 0b7ca5b9bfd42f1a5b23beba9dfbea8c --- build-with-cython3.patch | 17 +++++++++++++++++ python-PyYAML.changes | 12 ++++++++++++ python-PyYAML.spec | 18 ++++++++++-------- setuptools.patch | 11 ----------- 4 files changed, 39 insertions(+), 19 deletions(-) create mode 100644 build-with-cython3.patch delete mode 100644 setuptools.patch 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 f4857a9..6151804 100644 --- a/python-PyYAML.changes +++ b/python-PyYAML.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +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 + +- Switch to pyproject and autosetup macros. +- Drop patch setuptools.patch, we can now cope. + ------------------------------------------------------------------- Tue Sep 19 16:25:38 UTC 2023 - Dirk Müller diff --git a/python-PyYAML.spec b/python-PyYAML.spec index 658c0cc..7b2f3cf 100644 --- a/python-PyYAML.spec +++ b/python-PyYAML.spec @@ -1,7 +1,7 @@ # # spec file for package python-PyYAML # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,9 +24,11 @@ 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 -Patch0: setuptools.patch -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} BuildRequires: fdupes BuildRequires: libyaml-devel BuildRequires: python-rpm-macros @@ -46,17 +48,17 @@ PyYAML is applicable for a broad range of tasks from complex configuration files to object serialization and persistance. %prep -%setup -q -n PyYAML-%{version} -%patch0 -p1 +%autosetup -p1 -n PyYAML-%{version} %build export CFLAGS="%{optflags}" -%python_build +export PYYAML_FORCE_CYTHON=1 +%pyproject_wheel # Fix example permissions. find examples/ -type f | xargs chmod a-x %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitearch} %check @@ -71,6 +73,6 @@ ulimit -Sn 2048 %doc CHANGES README.md examples/ %{python_sitearch}/yaml %{python_sitearch}/_yaml -%{python_sitearch}/PyYAML-%{version}*-info +%{python_sitearch}/PyYAML-%{version}.dist-info %changelog diff --git a/setuptools.patch b/setuptools.patch deleted file mode 100644 index 47ec714..0000000 --- a/setuptools.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- PyYAML-6.0/setup.py 2021-10-13 21:13:52.000000000 +0200 -+++ PyYAML-6.0/setup.py.new 2021-11-03 14:36:40.093725379 +0100 -@@ -67,7 +67,7 @@ - import sys, os, os.path, pathlib, platform, shutil, tempfile, warnings - - # for newer setuptools, enable the embedded distutils before importing setuptools/distutils to avoid warnings --os.environ['SETUPTOOLS_USE_DISTUTILS'] = 'local' -+#os.environ['SETUPTOOLS_USE_DISTUTILS'] = 'local' - - from setuptools import setup, Command, Distribution as _Distribution, Extension as _Extension - from setuptools.command.build_ext import build_ext as _build_ext