Rebuild with python 3.14

This commit is contained in:
2026-05-06 21:24:03 +03:00
parent d53533e2ae
commit 211ac9861a
4 changed files with 104 additions and 15 deletions
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
# Github repository
REPO="seb-m/pyinotify"
# Get tag name using Github Rest API
TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/tags | jq -r '.[0].name')
echo "$TAG_NAME"
+9 -2
View File
@@ -1,13 +1,20 @@
name: python-pyinotify name: python-pyinotify
description: Python module for monitoring filesystems events with inotify on Linux description: Python module for monitoring filesystems events with inotify on Linux
version: 0.9.6 version: 0.9.6
revision: 1 revision: 2
url: https://github.com/seb-m/pyinotify url: https://github.com/seb-m/pyinotify
license: MIT license: MIT
maintainers:
- [email protected]
architecture: any architecture: any
output_architecture: any output_architecture: any
type: source type: source
depends: depends:
- python3 - python3=3.14.*
make_depends: make_depends:
- python-setuptools - python-setuptools
downloads:
- url: https://github.com/seb-m/pyinotify/archive/refs/tags/${BPM_PKG_VERSION}.tar.gz
extract_to: ${BPM_SOURCE}
extract_strip_components: 1
checksum: 7943f198c5cef2bdc121d847937fbe565daaa7d4daaf1b8de8ef5689812f481c
@@ -0,0 +1,82 @@
commit 478d595a7d086423733e9f5da5edfe9f1df48682
Author: Troy Curtis Jr <[email protected]>
Date: Thu Aug 10 21:51:15 2023 -0400
Make asyncore support optional for Python 3.
Fixes #204.
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 @@ from collections import deque
from datetime import datetime, timedelta
import time
import re
-import asyncore
import glob
import locale
import subprocess
@@ -1494,33 +1493,40 @@ class ThreadedNotifier(threading.Thread, Notifier):
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):
+4 -13
View File
@@ -2,26 +2,16 @@
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
DOWNLOAD="https://github.com/seb-m/pyinotify/archive/refs/tags/${BPM_PKG_VERSION}.tar.gz"
DOWNLOAD_PATCH="https://github.com/seb-m/pyinotify/commit/478d595a7d086423733e9f5da5edfe9f1df48682.patch"
FILENAME="${DOWNLOAD##*/}"
FILENAME_PATCH="${DOWNLOAD_PATCH##*/}"
# The prepare function is executed in the root of the temp directory # The prepare function is executed in the root of the temp directory
# This function is used for downloading files and putting them into the correct location # This function is used for putting downloaded files to the correct location or applying patches
prepare() { prepare() {
wget "$DOWNLOAD" cd "$BPM_SOURCE"
# Patch to make asyncore optional for Python 3.x patch -Np1 -i "$BPM_WORKDIR"/pyinotify-python-3.12-fix.patch
wget "$DOWNLOAD_PATCH"
tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE"
} }
# The build function is executed in the source directory # The build function is executed in the source directory
# This function is used to compile the source code # This function is used to compile the source code
build() { build() {
patch -Np1 < ../"${FILENAME_PATCH##*/}"
python3 setup.py build python3 setup.py build
} }
@@ -30,5 +20,6 @@ build() {
package() { package() {
python3 setup.py install --root="$BPM_OUTPUT" --prefix=/usr python3 setup.py install --root="$BPM_OUTPUT" --prefix=/usr
# Install package license
install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/python-pyinotify/COPYING install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/python-pyinotify/COPYING
} }