#1 Add a dirty patch to restore Python 3.9 support
Merged 2 years ago by rebus. Opened 2 years ago by churchyard.
rpms/ churchyard/python-pyev python3.9  into  master

file modified
+4 -3
@@ -36,7 +36,8 @@ 

  Source0:        https://github.com/%{gituser}/%{gitname}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz

  %endif #build_release

  

- 

+ # https://bugzilla.redhat.com/show_bug.cgi?id=1817984

+ Patch1:         python3.9.patch

  

  BuildRequires:  gcc

  BuildRequires:  libtool
@@ -73,11 +74,11 @@ 

  %prep

  %if 0%{?build_release} > 0

  # Build from git release version

- %autosetup -n %{gitname}-%{version}

+ %autosetup -p1 -n %{gitname}-%{version}

  

  %else

  # Build from git commit

- %autosetup  -n %{gitname}-%{commit}

+ %autosetup -p1 -n %{gitname}-%{commit}

  %endif

  

  

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

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

+ index 4cd36ee..e1e9931 100644

+ --- a/setup.py

+ +++ b/setup.py

+ @@ -18,7 +18,7 @@

+  #

+  

+  

+ -from distutils.version import StrictVersion

+ +from distutils.version import LooseVersion

+  from distutils.core import setup, Extension

+  

+  from ctypes.util import find_library

+ @@ -37,7 +37,7 @@ min_libev_version = "4.15"

+  version_error = "Aborted: pyev-{0} requires {{0}} >= {{1}}".format(pyev_version)

+  

+  def check_version(current_version, minimum_version, name):

+ -    if StrictVersion(current_version) < StrictVersion(minimum_version):

+ +    if LooseVersion(current_version) < LooseVersion(minimum_version):

+          raise SystemExit(version_error.format(name, minimum_version))

+  

+  

+ diff --git a/src/pyev.c b/src/pyev.c

+ index 47aa4bf..2e830ed 100644

+ --- a/src/pyev.c

+ +++ b/src/pyev.c

+ @@ -338,7 +338,7 @@ PyType_ReadyWatcher(PyTypeObject *type, PyTypeObject *base)

+  

+  

+  int

+ -PyModule_AddType(PyObject *module, const char *name, PyTypeObject *type)

+ +PyModule_AddType_(PyObject *module, const char *name, PyTypeObject *type)

+  {

+      if (PyType_Ready(type)) {

+          return -1;

+ @@ -555,7 +555,7 @@ init_pyev(void)

+      /* types and constants */

+      if (

+          /* loop */

+ -        PyModule_AddType(pyev, "Loop", &LoopType) ||

+ +        PyModule_AddType_(pyev, "Loop", &LoopType) ||

+          PyModule_AddUnsignedIntMacro(pyev, EVFLAG_AUTO) ||

+          PyModule_AddUnsignedIntMacro(pyev, EVFLAG_NOENV) ||

+          PyModule_AddUnsignedIntMacro(pyev, EVFLAG_FORKCHECK) ||

  • rename PyModule_AddType to PyModule_AddType_ to avoid collision
  • use LooseVersion, because StrictVersion cannot parse 3.9.0rc1

Pull-Request has been merged by rebus

2 years ago