11 Commits

Author SHA256 Message Date
3ad66f553d Accepting request 1302952 from devel:languages:python
- Add pytest-asyncio dependency and test-aio.patch to fix tests
- Skip some misbehaving tests

OBS-URL: https://build.opensuse.org/request/show/1302952
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-i3ipc?expand=0&rev=8
2025-09-05 19:44:49 +00:00
f889c009ae finally?
- Add pytest-asyncio dependency and test-aio.patch to fix tests
- Skip some misbehaving tests

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-i3ipc?expand=0&rev=23
2025-09-05 16:28:36 +00:00
66f5a292df sorry
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-i3ipc?expand=0&rev=22
2025-09-05 15:56:30 +00:00
bb5cc725c4 fix old leap
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-i3ipc?expand=0&rev=21
2025-09-05 15:52:21 +00:00
d782f2c495 iterate
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-i3ipc?expand=0&rev=20
2025-09-05 15:46:08 +00:00
bbce53c3ef second try
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-i3ipc?expand=0&rev=19
2025-09-05 15:43:36 +00:00
561d3d7e1e try to fix build with a patch
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-i3ipc?expand=0&rev=18
2025-09-05 15:37:09 +00:00
7c0ae2a56e - Add pytest-asyncio dependency to fix tests
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-i3ipc?expand=0&rev=17
2025-09-05 15:21:52 +00:00
742ee803e3 Accepting request 1280847 from devel:languages:python
- Convert to pip-based build

OBS-URL: https://build.opensuse.org/request/show/1280847
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-i3ipc?expand=0&rev=7
2025-05-30 12:33:53 +00:00
5c58eef630 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-i3ipc?expand=0&rev=15 2025-05-28 11:48:10 +00:00
0cb800ac0d - Convert to pip-based build
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-i3ipc?expand=0&rev=14
2025-05-28 11:45:36 +00:00
3 changed files with 55 additions and 10 deletions

View File

@@ -1,3 +1,14 @@
-------------------------------------------------------------------
Fri Sep 5 15:21:20 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Add pytest-asyncio dependency and test-aio.patch to fix tests
- Skip some misbehaving tests
-------------------------------------------------------------------
Wed May 28 11:44:55 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to pip-based build
-------------------------------------------------------------------
Fri Mar 4 08:27:56 UTC 2022 - pgajdos@suse.com

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-i3ipc
#
# Copyright (c) 2022 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
@@ -16,8 +16,6 @@
#
%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-i3ipc
# Before upgrading, verify compatibility with bumblebee-status module title
Version: 2.2.1
@@ -27,12 +25,17 @@ License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/altdesktop/i3ipc-python
Source0: https://github.com/altdesktop/i3ipc-python/archive/v%{version}.tar.gz#/i3ipc-%{version}.tar.gz
# PATCH-FIX-OPENSUSE https://github.com/altdesktop/i3ipc-python/issues/217
Patch0: test-aio.patch
BuildRequires: %{python_module asyncio}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest-asyncio}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module python-xlib}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
# for tests we need i3 at build time
BuildRequires: %{python_module python-xlib}
BuildRequires: %{python_module asyncio}
BuildRequires: i3
BuildRequires: python-rpm-macros
BuildRequires: xvfb-run
@@ -51,7 +54,7 @@ also features a publish/subscribe mechanism for notifying interested parties of
window manager events.
%prep
%setup -q -n i3ipc-python-%{version}
%autosetup -p1 -n i3ipc-python-%{version}
sed -i "s/'enum-compat'//" setup.py
# Remove shebang which is not needed (that script cannot be executed
@@ -62,26 +65,29 @@ sed -i '/^#!\/usr\/bin\/env.*/d' examples/*.py examples/i3-focus/*.py
find examples/ -name \*.py -exec chmod -x '{}' \;
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# test_shutdown_event_reconnect always fails
# test_restart fails on openSUSE/SLE 15
# test_window_event is intermittent
# test_detailed_window_event stucks in obs, not with the local build (https://github.com/altdesktop/i3ipc-python/issues/192)
# test_workspace gets stuck, test_event_exception and test_tick_event get lost in new asyncio loops https://github.com/altdesktop/i3ipc-python/issues/217
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib}
xvfb-run --server-args "-screen 0 1920x1080x24" \
$python -m pytest -k 'not (test_shutdown_event_reconnect or test_restart or test_window_event or test_detailed_window_event)'
$python -m pytest -k 'not (test_shutdown_event_reconnect or test_restart or test_window_event or test_detailed_window_event or test_workspace or test_event_exception or test_tick_event)'
}
%files %{python_files}
%license LICENSE
%doc README.rst CHANGELOG.md docs/*.rst
%doc examples/
%{python_sitelib}/*
%{python_sitelib}/i3ipc
%{python_sitelib}/i3ipc-%{version}*-info
%changelog

28
test-aio.patch Normal file
View File

@@ -0,0 +1,28 @@
Index: i3ipc-python-2.2.1/test/aio/ipctest.py
===================================================================
--- i3ipc-python-2.2.1.orig/test/aio/ipctest.py
+++ i3ipc-python-2.2.1/test/aio/ipctest.py
@@ -1,5 +1,9 @@
from subprocess import Popen
import pytest
+try:
+ from pytest_asyncio import fixture
+except ImportError:
+ from pytest import fixture
from i3ipc.aio import Connection
from i3ipc import CommandReply
@@ -15,11 +19,11 @@ class IpcTest:
timeout_thread = None
i3_conn = None
- @pytest.fixture(scope='class')
+ @fixture(scope='class')
def event_loop(self):
return asyncio.get_event_loop()
- @pytest.fixture(scope='class')
+ @fixture(scope='class')
async def i3(self):
process = Popen(['i3', '-c', 'test/i3.config'])
# wait for i3 to start up