From 7c0ae2a56e97638246e91c6065bc0844603ac028c7644fef523a741cb28a2fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Fri, 5 Sep 2025 15:21:52 +0000 Subject: [PATCH 1/7] - Add pytest-asyncio dependency to fix tests OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-i3ipc?expand=0&rev=17 --- .gitattributes | 23 ++++++++++++ .gitignore | 1 + i3ipc-2.2.1.tar.gz | 3 ++ python-i3ipc.changes | 66 ++++++++++++++++++++++++++++++++ python-i3ipc.spec | 89 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 182 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 i3ipc-2.2.1.tar.gz create mode 100644 python-i3ipc.changes create mode 100644 python-i3ipc.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/i3ipc-2.2.1.tar.gz b/i3ipc-2.2.1.tar.gz new file mode 100644 index 0000000..4c673c2 --- /dev/null +++ b/i3ipc-2.2.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54af180fac6e3e16c65747884ae4479f0df034c45ed02523f8300f98c99eb29e +size 51760 diff --git a/python-i3ipc.changes b/python-i3ipc.changes new file mode 100644 index 0000000..02a5210 --- /dev/null +++ b/python-i3ipc.changes @@ -0,0 +1,66 @@ +------------------------------------------------------------------- +Fri Sep 5 15:21:20 UTC 2025 - Markéta Machová + +- Add pytest-asyncio dependency to fix tests + +------------------------------------------------------------------- +Wed May 28 11:44:55 UTC 2025 - Markéta Machová + +- Convert to pip-based build + +------------------------------------------------------------------- +Fri Mar 4 08:27:56 UTC 2022 - pgajdos@suse.com + +- disable flaky test_detailed_window_event (stucks on obs for x86_64) + +------------------------------------------------------------------- +Thu Sep 23 09:48:08 UTC 2021 - Matej Cepl + +- Mark example scripts as non-executable + +------------------------------------------------------------------- +Sun Mar 7 12:17:37 UTC 2021 - Atri Bhattacharya + +- Fix Requires: python- instead of %{python } so + that python38- does not pull in python36-. + +------------------------------------------------------------------- +Mon Apr 6 07:38:48 UTC 2020 - Michael Vetter + +- Update to 2.2.1: + * includes sway comatibility enhancements (#98) and other bugfixes. + * Make the sway INPUT event subscribable (#127). + * Remove the enum-compat dependency (#128). + * Add examples and docs to MANIFEST.in (#132). + * Add sway-specific fields to OutputReply (#137). + * Add find_by_pid() method for sway (#142). + * Add side properties to Gaps object (#143). + * Add ipc_data attribute to objects (8947b9f). + * Add all known sway properties (e6c7f1b). + * Fix scratchpad for sway (f11e729). + * Bug: fix crash after reload then restart (#148). + +------------------------------------------------------------------- +Tue Mar 31 10:50:37 UTC 2020 - Michael Vetter + +- Update to 2.1.1: + * Regression: emit detailed events correctly (#126) + * Regression: null values in replies should be python None (#123) + * Add the sway input event (#122) + * Raise handler exceptions from Connection.main() (#125) + +------------------------------------------------------------------- +Sat Oct 19 12:01:34 UTC 2019 - John Vandenberg + +- Drop unnecessary dependency on python-devel +- Remove dependency on enum-compat, using python2-enum34 instead +- Add examples to docs +- Fix fdupes and tidy spec +- Activate test suite, with a few tests deselected due to + test runner environment +- Update to v1.7.1, last release supporting Python 2.7 + +------------------------------------------------------------------- +Sun Feb 24 12:50:43 UTC 2019 - Michał Rostecki + +- Initial release 1.6.0 diff --git a/python-i3ipc.spec b/python-i3ipc.spec new file mode 100644 index 0000000..dfe8d39 --- /dev/null +++ b/python-i3ipc.spec @@ -0,0 +1,89 @@ +# +# spec file for package python-i3ipc +# +# 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 +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: python-i3ipc +# Before upgrading, verify compatibility with bumblebee-status module title +Version: 2.2.1 +Release: 0 +Summary: Python library for i3 WM extensions +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 +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: i3 +BuildRequires: python-rpm-macros +BuildRequires: xvfb-run +Requires: python-python-xlib +BuildArch: noarch +%python_subpackages + +%description +python-i3ipc is a Python library for controlling the i3 window manager which +aims to be used by scripts and applications which interact with the window +manager like status line generators, notification daemons and pagers. + +This library uses i3’s interprocess communication, which is the interface +that i3 WM uses to receive commands from client applications such as i3-msg. It +also features a publish/subscribe mechanism for notifying interested parties of +window manager events. + +%prep +%setup -q -n i3ipc-python-%{version} +sed -i "s/'enum-compat'//" setup.py + +# Remove shebang which is not needed (that script cannot be executed +# standalone). +sed -i '/^#!\/usr\/bin\/env.*/d' examples/*.py examples/i3-focus/*.py + +# Examples shouldn't be executable +find examples/ -name \*.py -exec chmod -x '{}' \; + +%build +%pyproject_wheel + +%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) +%{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)' +} + +%files %{python_files} +%license LICENSE +%doc README.rst CHANGELOG.md docs/*.rst +%doc examples/ +%{python_sitelib}/i3ipc +%{python_sitelib}/i3ipc-%{version}*-info + +%changelog From 561d3d7e1e3cb25e1ae8614308c2802114eb88b87f79c012364652e203c35cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Fri, 5 Sep 2025 15:37:09 +0000 Subject: [PATCH 2/7] try to fix build with a patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-i3ipc?expand=0&rev=18 --- python-i3ipc.spec | 3 ++- test-aio.patch | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 test-aio.patch diff --git a/python-i3ipc.spec b/python-i3ipc.spec index dfe8d39..0d20abe 100644 --- a/python-i3ipc.spec +++ b/python-i3ipc.spec @@ -25,6 +25,7 @@ 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 +Patch0: test-aio.patch BuildRequires: %{python_module asyncio} BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest-asyncio} @@ -52,7 +53,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 diff --git a/test-aio.patch b/test-aio.patch new file mode 100644 index 0000000..de50f26 --- /dev/null +++ b/test-aio.patch @@ -0,0 +1,13 @@ +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 +@@ -20,7 +20,7 @@ class IpcTest: + return asyncio.get_event_loop() + + @pytest.fixture(scope='class') +- async def i3(self): ++ async def i3(self, i3): + process = Popen(['i3', '-c', 'test/i3.config']) + # wait for i3 to start up + tries = 0 From bbce53c3ef5c1abf24e8559e0aca448775df2e8784fde5b53b418b818604d3f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Fri, 5 Sep 2025 15:43:36 +0000 Subject: [PATCH 3/7] second try OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-i3ipc?expand=0&rev=19 --- test-aio.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test-aio.patch b/test-aio.patch index de50f26..ef94aeb 100644 --- a/test-aio.patch +++ b/test-aio.patch @@ -2,12 +2,12 @@ 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 -@@ -20,7 +20,7 @@ class IpcTest: +@@ -19,7 +19,7 @@ class IpcTest: + def event_loop(self): return asyncio.get_event_loop() - @pytest.fixture(scope='class') -- async def i3(self): -+ async def i3(self, i3): +- @pytest.fixture(scope='class') ++ @pytest_asyncio.fixture(scope='class') + async def i3(self): process = Popen(['i3', '-c', 'test/i3.config']) # wait for i3 to start up - tries = 0 From d782f2c4959e237c5b611a04be567bb658422f0874a2a7139e3226ea60d67e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Fri, 5 Sep 2025 15:46:08 +0000 Subject: [PATCH 4/7] iterate OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-i3ipc?expand=0&rev=20 --- test-aio.patch | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test-aio.patch b/test-aio.patch index ef94aeb..13e88c9 100644 --- a/test-aio.patch +++ b/test-aio.patch @@ -2,7 +2,14 @@ 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 -@@ -19,7 +19,7 @@ class IpcTest: +@@ -1,5 +1,6 @@ + from subprocess import Popen + import pytest ++import pytest_asyncio + + from i3ipc.aio import Connection + from i3ipc import CommandReply +@@ -19,7 +20,7 @@ class IpcTest: def event_loop(self): return asyncio.get_event_loop() From bb5cc725c42cca5aac710f149294eeff8e685a27cc664c6aea439bcf964a4318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Fri, 5 Sep 2025 15:52:21 +0000 Subject: [PATCH 5/7] fix old leap OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-i3ipc?expand=0&rev=21 --- test-aio.patch | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test-aio.patch b/test-aio.patch index 13e88c9..3803365 100644 --- a/test-aio.patch +++ b/test-aio.patch @@ -2,19 +2,27 @@ 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,6 @@ +@@ -1,5 +1,9 @@ from subprocess import Popen import pytest -+import pytest_asyncio ++try: ++ from pytest_asyncio import fixture ++except ImportError: ++ from pytest_asyncio import fixture from i3ipc.aio import Connection from i3ipc import CommandReply -@@ -19,7 +20,7 @@ class IpcTest: +@@ -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') -+ @pytest_asyncio.fixture(scope='class') ++ @fixture(scope='class') async def i3(self): process = Popen(['i3', '-c', 'test/i3.config']) # wait for i3 to start up From 66f5a292dfb642f3ae12da8940bee444c6e56388e3822ef530c5761ab25a545d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Fri, 5 Sep 2025 15:56:30 +0000 Subject: [PATCH 6/7] sorry OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-i3ipc?expand=0&rev=22 --- test-aio.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-aio.patch b/test-aio.patch index 3803365..3b3d19b 100644 --- a/test-aio.patch +++ b/test-aio.patch @@ -8,7 +8,7 @@ Index: i3ipc-python-2.2.1/test/aio/ipctest.py +try: + from pytest_asyncio import fixture +except ImportError: -+ from pytest_asyncio import fixture ++ from pytest import fixture from i3ipc.aio import Connection from i3ipc import CommandReply From f889c009ae212ecc51c0bf894d636356129b0a3c1169ce731616cbb7aaa97cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Fri, 5 Sep 2025 16:28:36 +0000 Subject: [PATCH 7/7] 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 --- python-i3ipc.changes | 3 ++- python-i3ipc.spec | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/python-i3ipc.changes b/python-i3ipc.changes index 02a5210..1b167b0 100644 --- a/python-i3ipc.changes +++ b/python-i3ipc.changes @@ -1,7 +1,8 @@ ------------------------------------------------------------------- Fri Sep 5 15:21:20 UTC 2025 - Markéta Machová -- Add pytest-asyncio dependency to fix tests +- 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á diff --git a/python-i3ipc.spec b/python-i3ipc.spec index 0d20abe..ad1702a 100644 --- a/python-i3ipc.spec +++ b/python-i3ipc.spec @@ -25,6 +25,7 @@ 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} @@ -71,13 +72,15 @@ find examples/ -name \*.py -exec chmod -x '{}' \; %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}