summaryrefslogtreecommitdiff
path: root/dev-python/irc
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/irc')
-rw-r--r--dev-python/irc/Manifest1
-rw-r--r--dev-python/irc/files/irc-20.5.0-py314.patch49
-rw-r--r--dev-python/irc/irc-20.5.0-r1.ebuild53
-rw-r--r--dev-python/irc/metadata.xml21
4 files changed, 124 insertions, 0 deletions
diff --git a/dev-python/irc/Manifest b/dev-python/irc/Manifest
new file mode 100644
index 000000000000..a3d73c33f81f
--- /dev/null
+++ b/dev-python/irc/Manifest
@@ -0,0 +1 @@
+DIST irc-20.5.0.tar.gz 92150 BLAKE2B 4a0d600fc4184e8fe1e9b16be4c45d00033120ec1b61b40cda7c859aceae66021abab462acb517a0c52eda52895e93314829ce4181e0efa630de8d4a5a8111fa SHA512 599cc837d8f624699004eb01181af6437e5a3d15e647f6d3ac8b014bfed467196ac3850f4d3ed33095f7a64177b0b22959f46e3b80aaa9c93570d141ace9a9d0
diff --git a/dev-python/irc/files/irc-20.5.0-py314.patch b/dev-python/irc/files/irc-20.5.0-py314.patch
new file mode 100644
index 000000000000..c88b40657b0c
--- /dev/null
+++ b/dev-python/irc/files/irc-20.5.0-py314.patch
@@ -0,0 +1,49 @@
+From 074b807361164e1522b64a225f4647a8b4bb53b8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ondrej=20Mosn=C3=A1=C4=8Dek?= <omosnacek@gmail.com>
+Date: Sat, 23 Nov 2024 10:25:44 +0100
+Subject: [PATCH] Fix "There is no current event loop" in the asyncio test
+
+This bug is causing the test to fail under Python 3.14. Fix it by
+calling asyncio.new_event_loop() and asyncio.set_event_loop() as
+recommended in: https://stackoverflow.com/a/73367187
+
+Fixes #197
+---
+ irc/tests/test_client_aio.py | 13 ++-----------
+ 1 file changed, 2 insertions(+), 11 deletions(-)
+
+diff --git a/irc/tests/test_client_aio.py b/irc/tests/test_client_aio.py
+index 962cbde..00a02f6 100644
+--- a/irc/tests/test_client_aio.py
++++ b/irc/tests/test_client_aio.py
+@@ -1,6 +1,4 @@
+ import asyncio
+-import contextlib
+-import warnings
+ from unittest.mock import MagicMock
+
+ from irc import client_aio
+@@ -13,21 +11,14 @@ async def mock_create_connection(*args, **kwargs):
+ return mock_create_connection
+
+
+-@contextlib.contextmanager
+-def suppress_issue_197():
+- with warnings.catch_warnings():
+- warnings.filterwarnings('ignore', 'There is no current event loop')
+- yield
+-
+-
+ def test_privmsg_sends_msg():
+ # create dummy transport, protocol
+ mock_transport = MagicMock()
+ mock_protocol = MagicMock()
+
+ # connect to dummy server
+- with suppress_issue_197():
+- loop = asyncio.get_event_loop()
++ loop = asyncio.new_event_loop()
++ asyncio.set_event_loop(loop)
+ loop.create_connection = make_mocked_create_connection(
+ mock_transport, mock_protocol
+ )
diff --git a/dev-python/irc/irc-20.5.0-r1.ebuild b/dev-python/irc/irc-20.5.0-r1.ebuild
new file mode 100644
index 000000000000..ee7f5abaaf0a
--- /dev/null
+++ b/dev-python/irc/irc-20.5.0-r1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{13..14} )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="IRC client framework written in Python"
+HOMEPAGE="
+ https://github.com/jaraco/irc/
+ https://pypi.org/project/irc/
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 arm64 ~riscv x86"
+IUSE="examples"
+
+RDEPEND="
+ dev-python/jaraco-collections[${PYTHON_USEDEP}]
+ >=dev-python/jaraco-functools-1.20[${PYTHON_USEDEP}]
+ dev-python/jaraco-logging[${PYTHON_USEDEP}]
+ dev-python/jaraco-stream[${PYTHON_USEDEP}]
+ >=dev-python/jaraco-text-3.14[${PYTHON_USEDEP}]
+ dev-python/more-itertools[${PYTHON_USEDEP}]
+ dev-python/pytz[${PYTHON_USEDEP}]
+ >=dev-python/tempora-1.6[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep '
+ dev-python/importlib-resources[${PYTHON_USEDEP}]
+ ' 3.11)
+"
+BDEPEND="
+ >=dev-python/setuptools-scm-3.4.1[${PYTHON_USEDEP}]
+"
+
+EPYTEST_PLUGINS=()
+distutils_enable_tests pytest
+
+PATCHES=(
+ # https://github.com/jaraco/irc/pull/236
+ "${FILESDIR}/${P}-py314.patch"
+)
+
+python_install_all() {
+ if use examples; then
+ docompress -x "/usr/share/doc/${PF}/scripts"
+ dodoc -r scripts
+ fi
+ distutils-r1_python_install_all
+}
diff --git a/dev-python/irc/metadata.xml b/dev-python/irc/metadata.xml
new file mode 100644
index 000000000000..6505b732f6ce
--- /dev/null
+++ b/dev-python/irc/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>sbraz@gentoo.org</email>
+ <name>Louis Sautier</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <longdescription>
+ This project includes an event-driven IRC client framework written in Python,
+ as well as an object-oriented wrapper class and some example programs.
+ </longdescription>
+ <stabilize-allarches />
+ <upstream>
+ <bugs-to>https://github.com/jaraco/irc/issues</bugs-to>
+ </upstream>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>