#8 Use Cython 3 for building
Merged 6 months ago by rominf. Opened 6 months ago by churchyard.
rpms/ churchyard/python-uvloop cython3  into  rawhide

file added
+77
@@ -0,0 +1,77 @@ 

+ From 8e5da4e53daf03089ad83e007d378a4888fca729 Mon Sep 17 00:00:00 2001

+ From: Anton Zhukharev <ancieg@altlinux.org>

+ Date: Tue, 19 Dec 2023 12:41:58 +0300

+ Subject: [PATCH] fix compatibility with cython>3

+ 

+ ---

+  uvloop/loop.pyx | 8 ++++----

+  1 file changed, 4 insertions(+), 4 deletions(-)

+ 

+ diff --git a/uvloop/loop.pyx b/uvloop/loop.pyx

+ index b0ffa8b..fb1d5e6 100644

+ --- a/uvloop/loop.pyx

+ +++ b/uvloop/loop.pyx

+ @@ -1397,7 +1397,7 @@ cdef class Loop:

+          self._debug = bool(enabled)

+          if self.is_running():

+              self.call_soon_threadsafe(

+ -                self._set_coroutine_debug, self, self._debug)

+ +                self._set_coroutine_debug, self._debug)

+ 

+      def is_running(self):

+          """Return whether the event loop is currently running."""

+ @@ -2749,8 +2749,7 @@ cdef class Loop:

+                                 start_new_session=False,

+                                 executable=None,

+                                 pass_fds=(),

+ -                               # For tests only! Do not use in your code. Ever.

+ -                               __uvloop_sleep_after_fork=False):

+ +                               **kwargs):

+ 

+          # TODO: Implement close_fds (might not be very important in

+          # Python 3.5, since all FDs aren't inheritable by default.)

+ @@ -2770,7 +2769,8 @@ cdef class Loop:

+          if executable is not None:

+              args[0] = executable

+ 

+ -        if __uvloop_sleep_after_fork:

+ +        # For tests only! Do not use in your code. Ever.

+ +        if kwargs.get('__uvloop_sleep_after_fork'):

+              debug_flags |= __PROCESS_DEBUG_SLEEP_AFTER_FORK

+ 

+          waiter = self._new_future()

+ diff --git a/pyproject.toml b/pyproject.toml

+ index 0d6d472..daf89f7 100644

+ --- a/pyproject.toml

+ +++ b/pyproject.toml

+ @@ -44,7 +44,7 @@ test = [

+      'pycodestyle~=2.9.0',

+      'pyOpenSSL~=23.0.0',

+      'mypy>=0.800',

+ -    'Cython(>=0.29.36,<0.30.0)',

+ +    'Cython>=3',

+  ]

+  docs = [

+      'Sphinx~=4.1.2',

+ @@ -56,7 +56,7 @@ docs = [

+  requires = [

+      "setuptools>=60",

+      "wheel",

+ -    "Cython(>=0.29.36,<0.30.0)",

+ +    "Cython>=3",

+  ]

+  build-backend = "setuptools.build_meta"

+  

+ diff --git a/setup.py b/setup.py

+ index 5afaee9..d692d3c 100644

+ --- a/setup.py

+ +++ b/setup.py

+ @@ -21,7 +21,7 @@ from setuptools.command.build_ext import build_ext

+  from setuptools.command.sdist import sdist

+  

+  

+ -CYTHON_DEPENDENCY = 'Cython(>=0.29.36,<0.30.0)'

+ +CYTHON_DEPENDENCY = 'Cython>=3'

+  MACHINE = platform.machine()

+  MODULES_CFLAGS = [os.getenv('UVLOOP_OPT_CFLAGS', '-O2')]

+  _ROOT = pathlib.Path(__file__).parent

file modified
+6 -4
@@ -7,6 +7,12 @@ 

  URL:            https://github.com/MagicStack/uvloop

  Source:         %{url}/archive/v%{version}/uvloop-%{version}.tar.gz

  

+ # Fix compatibility with Cython 3.

+ # Notice that it doesn't work with older Cython (<3).

+ # From https://github.com/MagicStack/uvloop/issues/586#issuecomment-1862458472

+ # Amended metadata changes to BuildRequire Cython>=3.

+ Patch:          cython3.patch

+ 

  BuildRequires:  gcc

  BuildRequires:  libuv-devel

  
@@ -53,10 +59,6 @@ 

  # We don’t have aiohttp==3.9.0b0; see if we can make do with the packaged

  # version.

  sed -r -i 's/aiohttp==3.9.0b0;/aiohttp>=3.8.5;/' pyproject.toml

- # Similarly:

- # Cython 0.29.36 is available

- # https://bugzilla.redhat.com/show_bug.cgi?id=2244399

- sed -r -i 's/(Cython\(>=0.29.3)6,/\15,/' pyproject.toml setup.py

  

  %generate_buildrequires

  %pyproject_buildrequires -x test

Pull-Request has been merged by rominf

6 months ago

Building python-uvloop-0.18.0-2.fc40 for rawhide
Created task: 110912150
Task info: https://koji.fedoraproject.org/koji/taskinfo?taskID=110912150

Metadata