14
0
forked from pool/python-pika

2 Commits

3 changed files with 39 additions and 5 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Nov 12 03:59:50 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-python314.patch:
* Support Python 3.14 asyncio changes.
-------------------------------------------------------------------
Mon Nov 13 09:33:54 UTC 2023 - Dirk Müller <dmueller@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file
# spec file for package python-pika
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -23,9 +23,10 @@ Version: 1.3.2
Release: 0
Summary: Pika Python AMQP Client Library
License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/pika/pika
Source: https://github.com/pika/pika/archive/%{version}.tar.gz
# PATCH-FIX-UPSTREAM Based on gh#pika/pika#1524
Patch0: support-python314.patch
BuildRequires: %{python_module Twisted}
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module pip}
@@ -47,7 +48,7 @@ library. Pika was developed primarily for use with RabbitMQ, but
should also work with other AMQP 0-9-1 brokers.
%prep
%setup -q -n %{mod_name}-%{version}
%autosetup -p1 -n %{mod_name}-%{version}
# acceptance needs running configured server
rm -rf tests/acceptance/
@@ -57,7 +58,6 @@ rm -rf tests/acceptance/
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}/%{mod_name}
%python_expand %fdupes %{buildroot}%{$python_sitelib}/*.egg-info
%check
# E ModuleNotFoundError: No module named 'tests'

28
support-python314.patch Normal file
View File

@@ -0,0 +1,28 @@
From 114dbb5bc8a88c056cfb72697390f5cf7957580e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Sat, 7 Jun 2025 20:06:42 +0200
Subject: [PATCH] Fix tests with Python 3.14, except RuntimeError from
asyncio.get_event_loop
Fixes https://github.com/pika/pika/issues/1479
---
tests/unit/io_services_test_stubs_test.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: pika-1.3.2/tests/unit/io_services_test_stubs_test.py
===================================================================
--- pika-1.3.2.orig/tests/unit/io_services_test_stubs_test.py
+++ pika-1.3.2/tests/unit/io_services_test_stubs_test.py
@@ -42,7 +42,11 @@ _SUPPORTED_LOOP_CLASSES = {
if asyncio is not None:
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
- _SUPPORTED_LOOP_CLASSES.add(asyncio.get_event_loop().__class__)
+ try:
+ loop = asyncio.get_event_loop()
+ except RuntimeError:
+ loop = asyncio.new_event_loop()
+ _SUPPORTED_LOOP_CLASSES.add(loop.__class__)
class TestStartCalledFromOtherThreadAndWithVaryingNativeLoops(