unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars-Dominik Braun <ldb@leibniz-psychology.org>
To: 42344@debbugs.gnu.org
Subject: [bug#42344] [PATCH] gnu: Fix python-aionotify testcases with Python 3.8
Date: Mon, 13 Jul 2020 17:29:56 +0200	[thread overview]
Message-ID: <20200713152956.GA3240@zpidnp36> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 154 bytes --]

Hi,

python-aionotify’s upstream seems to be dead, so I’m sending a patch that at
least fixes the package with Python 3.8 here in Guix.

Lars


[-- Attachment #1.2: 0001-gnu-Fix-python-aionotify-testcases-with-Python-3.8.patch --]
[-- Type: text/x-diff, Size: 3804 bytes --]

From c0bf6b640a7f91d78b89c4aa86818345c40e44b0 Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <lars@6xq.net>
Date: Mon, 13 Jul 2020 17:25:00 +0200
Subject: [PATCH] gnu: Fix python-aionotify testcases with Python 3.8

* gnu/packages/python-xyz.scm (patches): Add fix.
* gnu/packages/patches/python-aionotify-0.2.0-py3.8.patch: New file.
* gnu/local.mk: Add it.
---
 gnu/local.mk                                  |  1 +
 .../python-aionotify-0.2.0-py3.8.patch        | 48 +++++++++++++++++++
 gnu/packages/python-xyz.scm                   |  4 +-
 3 files changed, 51 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/python-aionotify-0.2.0-py3.8.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ddd024677a..b6d5592ccd 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1437,6 +1437,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-3.8-fix-tests.patch		\
   %D%/packages/patches/python-CVE-2018-14647.patch		\
   %D%/packages/patches/python-aiohttp-3.6.2-no-warning-fail.patch	\
+  %D%/packages/patches/python-aionotify-0.2.0-py3.8.patch	\
   %D%/packages/patches/python-alembic-exceptions-cause.patch	\
   %D%/packages/patches/python-argcomplete-1.11.1-fish31.patch	\
   %D%/packages/patches/python-axolotl-AES-fix.patch		\
diff --git a/gnu/packages/patches/python-aionotify-0.2.0-py3.8.patch b/gnu/packages/patches/python-aionotify-0.2.0-py3.8.patch
new file mode 100644
index 0000000000..ebeef34720
--- /dev/null
+++ b/gnu/packages/patches/python-aionotify-0.2.0-py3.8.patch
@@ -0,0 +1,48 @@
+Compatibility with Python 3.8, see upstream issue
+https://github.com/rbarrois/aionotify/pull/15
+
+diff --git a/setup.py b/setup.py
+index 21a554f..094de64 100755
+--- a/setup.py
++++ b/setup.py
+@@ -40,7 +40,7 @@ setup(
+     setup_requires=[
+     ],
+     tests_require=[
+-        'asynctest',
++        'asynctest; python_version<"3.8"',
+     ],
+     classifiers=[
+         "Development Status :: 4 - Beta",
+diff --git a/tests/test_usage.py b/tests/test_usage.py
+index f156291..0476ff1 100644
+--- a/tests/test_usage.py
++++ b/tests/test_usage.py
+@@ -8,7 +8,11 @@ import os.path
+ import tempfile
+ import unittest
+ 
+-import asynctest
++try:
++    testBase = unittest.IsolatedAsyncioTestCase
++except AttributeError:
++    import asynctest
++    testBase = asynctest.TestCase
+ 
+ import aionotify
+ 
+@@ -25,11 +29,13 @@ if AIODEBUG:
+ TESTDIR = os.environ.get('AIOTESTDIR') or os.path.join(os.path.dirname(__file__), 'testevents')
+ 
+ 
+-class AIONotifyTestCase(asynctest.TestCase):
++class AIONotifyTestCase(testBase):
+     forbid_get_event_loop = True
+     timeout = 3
+ 
+     def setUp(self):
++        if not getattr (self, 'loop', None):
++            self.loop = asyncio.get_event_loop()
+         if AIODEBUG:
+             self.loop.set_debug(True)
+         self.watcher = aionotify.Watcher()
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6fe2ca0a2e..7739772292 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19237,9 +19237,9 @@ and cuts down boilerplate code when testing libraries for asyncio.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1sk9i8czxgsbrswsf1nlb4c82vgnlzi8zrvrxdip92w2z8hqh43y"))))
+        (base32 "1sk9i8czxgsbrswsf1nlb4c82vgnlzi8zrvrxdip92w2z8hqh43y"))
+       (patches (search-patches "python-aionotify-0.2.0-py3.8.patch"))))
     (build-system python-build-system)
-    (native-inputs `(("python-asynctest" ,python-asynctest)))
     (home-page "https://github.com/rbarrois/aionotify")
     (synopsis "Asyncio-powered inotify library")
     (description
-- 
2.26.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

             reply	other threads:[~2020-07-13 15:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13 15:29 Lars-Dominik Braun [this message]
2020-07-20 21:24 ` bug#42344: [PATCH] gnu: Fix python-aionotify testcases with Python 3.8 Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200713152956.GA3240@zpidnp36 \
    --to=ldb@leibniz-psychology.org \
    --cc=42344@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).