summaryrefslogtreecommitdiff
path: root/dev-python/pyinotify
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-11-08 10:24:46 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-11-08 10:24:46 +0000
commit9263a8dda30106335f556e7f5936f5607db6f92c (patch)
tree59614d42ee7ac6187fd0c542956f2aa89c39f6e9 /dev-python/pyinotify
parentd8ae0501eb6c157339ede48ca34513d27470e1dc (diff)
gentoo auto-resync : 08:11:2023 - 10:24:46
Diffstat (limited to 'dev-python/pyinotify')
-rw-r--r--dev-python/pyinotify/Manifest3
-rw-r--r--dev-python/pyinotify/files/pyinotify-0.9.6-py312.patch84
-rw-r--r--dev-python/pyinotify/pyinotify-0.9.6-r1.ebuild14
3 files changed, 96 insertions, 5 deletions
diff --git a/dev-python/pyinotify/Manifest b/dev-python/pyinotify/Manifest
index 3c632d66f8aa..3d017b1059b0 100644
--- a/dev-python/pyinotify/Manifest
+++ b/dev-python/pyinotify/Manifest
@@ -1,3 +1,4 @@
+AUX pyinotify-0.9.6-py312.patch 3205 BLAKE2B 8b692c55f01abdcab744317a7b1563857d4370c027986a7a4946e90f5244841a85d069a2777ad98e770c666fa224581a14cab8d5281c1233d09aee98dfe25071 SHA512 3c3b0df97e98d1c5f376f02fb584f89f57cc2cc18cc3fb36217c1ceb5bef8c8ea4669a5e8139bd6d8138dbdfd3a9d1ff842955bc8afc7e6d026019fc478382b7
DIST pyinotify-0.9.6.tar.gz 60998 BLAKE2B 7fb55cfe5b2c02682b5842d95859a58f218ab591a4eee689b707e804c6fe8cde4cc1fb3dfbf54a044ff743deefa0ee5551bc6e27ca4dda1c608218a6c24597b2 SHA512 b52de43293b06b32236e90b7c33fac061f3095cd7d4aecec89a099d56020db1a85440ab9dcc8b521238c001fc49a1f37d1b16d621bc1acab4d7273aebcaadbc5
-EBUILD pyinotify-0.9.6-r1.ebuild 849 BLAKE2B 7445df1d0f24a0e1a3fc39cae1f780d291472f5912439b75fb61b54872d85c94e94b95a115ab0f3caf90910677875ec6f8cb3661d4408505d76592f3b2cf4a04 SHA512 70babd3724b4636e6010654d5f88fbafbc54ff835fd9fd731fa3704043856f6696fa59f358ba773b2eddced629b2316fbfba04a1a9a2d361414b220d0e179271
+EBUILD pyinotify-0.9.6-r1.ebuild 824 BLAKE2B 0d30b00e826947af1ea058d3ddbf43db39d91efa14ca1ae3772c7a0e4381f01ba26caf59badc9d97bb6f29ec6fefc428459eb1c128e9ccf08d88487bbbf22953 SHA512 53922802b75eed3585615ec6d9da321176af5f224a8907178fb241a530f50e6842d4a8a90c51203610bcb6753753adbe355800c18c568c35b86b35b84364526d
MISC metadata.xml 392 BLAKE2B 2a93eeba71631eaa13849f4a378cd7e8ddaba38e1e22c8b7baea9e8c81f0e922cde667a9088590b88b0c374f9aad8251bf8f8f2076c3bf4611c1927e941d6987 SHA512 0efd77ede60fbd00ed4b452455fe7bef88e53ddecb5eef808474251f0cd87c8c87749a6f260f76c5dadb2e4d913109602707857a403925b6b20e26f56dfdc9b3
diff --git a/dev-python/pyinotify/files/pyinotify-0.9.6-py312.patch b/dev-python/pyinotify/files/pyinotify-0.9.6-py312.patch
new file mode 100644
index 000000000000..6f8f65545b8c
--- /dev/null
+++ b/dev-python/pyinotify/files/pyinotify-0.9.6-py312.patch
@@ -0,0 +1,84 @@
+From 478d595a7d086423733e9f5da5edfe9f1df48682 Mon Sep 17 00:00:00 2001
+From: Troy Curtis Jr <troy@troycurtisjr.com>
+Date: Thu, 10 Aug 2023 21:51:15 -0400
+Subject: [PATCH] Make asyncore support optional for Python 3.
+
+Fixes #204.
+---
+ python3/pyinotify.py | 50 +++++++++++++++++++++++++-------------------
+ 1 file changed, 28 insertions(+), 22 deletions(-)
+
+diff --git a/python3/pyinotify.py b/python3/pyinotify.py
+index bc24313..f4a5a90 100755
+--- a/python3/pyinotify.py
++++ b/python3/pyinotify.py
+@@ -68,7 +68,6 @@ def __init__(self, version):
+ from datetime import datetime, timedelta
+ import time
+ import re
+-import asyncore
+ import glob
+ import locale
+ import subprocess
+@@ -1494,33 +1493,40 @@ def run(self):
+ self.loop()
+
+
+-class AsyncNotifier(asyncore.file_dispatcher, Notifier):
+- """
+- This notifier inherits from asyncore.file_dispatcher in order to be able to
+- use pyinotify along with the asyncore framework.
++try:
++ import asyncore
+
+- """
+- def __init__(self, watch_manager, default_proc_fun=None, read_freq=0,
+- threshold=0, timeout=None, channel_map=None):
++ class AsyncNotifier(asyncore.file_dispatcher, Notifier):
+ """
+- Initializes the async notifier. The only additional parameter is
+- 'channel_map' which is the optional asyncore private map. See
+- Notifier class for the meaning of the others parameters.
++ This notifier inherits from asyncore.file_dispatcher in order to be able to
++ use pyinotify along with the asyncore framework.
+
+ """
+- Notifier.__init__(self, watch_manager, default_proc_fun, read_freq,
+- threshold, timeout)
+- asyncore.file_dispatcher.__init__(self, self._fd, channel_map)
++ def __init__(self, watch_manager, default_proc_fun=None, read_freq=0,
++ threshold=0, timeout=None, channel_map=None):
++ """
++ Initializes the async notifier. The only additional parameter is
++ 'channel_map' which is the optional asyncore private map. See
++ Notifier class for the meaning of the others parameters.
+
+- def handle_read(self):
+- """
+- When asyncore tells us we can read from the fd, we proceed processing
+- events. This method can be overridden for handling a notification
+- differently.
++ """
++ Notifier.__init__(self, watch_manager, default_proc_fun, read_freq,
++ threshold, timeout)
++ asyncore.file_dispatcher.__init__(self, self._fd, channel_map)
+
+- """
+- self.read_events()
+- self.process_events()
++ def handle_read(self):
++ """
++ When asyncore tells us we can read from the fd, we proceed processing
++ events. This method can be overridden for handling a notification
++ differently.
++
++ """
++ self.read_events()
++ self.process_events()
++except ImportError:
++ # asyncore was removed in Python 3.12, but try the import instead of a
++ # version check in case the compatibility package is installed.
++ pass
+
+
+ class TornadoAsyncNotifier(Notifier):
diff --git a/dev-python/pyinotify/pyinotify-0.9.6-r1.ebuild b/dev-python/pyinotify/pyinotify-0.9.6-r1.ebuild
index e634cade25b1..2398f2c70957 100644
--- a/dev-python/pyinotify/pyinotify-0.9.6-r1.ebuild
+++ b/dev-python/pyinotify/pyinotify-0.9.6-r1.ebuild
@@ -4,8 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
-# py3.12 does not work, see https://github.com/seb-m/pyinotify/issues/204
-PYTHON_COMPAT=( python3_{10..11} pypy3 )
+PYTHON_COMPAT=( python3_{10..12} pypy3 )
PYTHON_REQ_USE="threads(+)"
inherit distutils-r1
@@ -13,14 +12,21 @@ inherit distutils-r1
DESCRIPTION="Python module used for monitoring filesystems events"
HOMEPAGE="
https://pypi.org/project/pyinotify/
- https://github.com/seb-m/pyinotify/"
-SRC_URI="https://seb.dbzteam.org/pub/pyinotify/releases/${P}.tar.gz"
+ https://github.com/seb-m/pyinotify/
+"
+SRC_URI="
+ https://seb.dbzteam.org/pub/pyinotify/releases/${P}.tar.gz
+"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
IUSE="examples"
+PATCHES=(
+ "${FILESDIR}/${P}-py312.patch"
+)
+
python_install_all() {
if use examples; then
dodoc -r python3/examples