Skip to content

Commit 961b923

Browse files
authored
python-xlib: Fix build with setuptools 82 (#9183)
**Summary** Fix build with setuptools 82. See python-xlib/python-xlib#290 **Test Plan** See that the build was successful. **Checklist** - [x] Package was built and tested against unstable - [ ] This change could gainfully be listed in the weekly sync notes once merged <!-- Write an appropriate message in the Summary section, then add the "Topic: Sync Notes" label --> - [x] I agree to license this contribution and all my previous contributions under the licensing terms in [LICENSE.md](../blob/main/LICENSE.md) and have the power and authority to grant those licenses.
2 parents 4e35855 + 49abf8a commit 961b923

3 files changed

Lines changed: 46 additions & 9 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Evan Maddock <maddock.evan@vivaldi.net>
3+
Date: Mon, 8 Jun 2026 19:01:47 -0400
4+
Subject: [PATCH] build: Migrate from pkg_resources to importlib
5+
6+
Setuptools 82 removed the `pkg_resources` module.
7+
The replacement is `importlib`. This fixes the use
8+
of the removed module.
9+
10+
Signed-off-by: Evan Maddock <maddock.evan@vivaldi.net>
11+
---
12+
setup.py | 7 ++++---
13+
1 file changed, 4 insertions(+), 3 deletions(-)
14+
15+
diff --git a/setup.py b/setup.py
16+
index 71bdb08..a380e2e 100644
17+
--- a/setup.py
18+
+++ b/setup.py
19+
@@ -1,12 +1,13 @@
20+
# Distutils script for python-xlib
21+
22+
-from pkg_resources import parse_requirements
23+
+from importlib.metadata import version
24+
from setuptools import (__version__ as setuptools_version, setup)
25+
26+
27+
# Check setuptools is recent enough to support `setup.cfg`.
28+
-setuptools_require = next(parse_requirements('setuptools>=30.3.0'))
29+
-assert setuptools_version in setuptools_require, '{} is required'.format(setuptools_require)
30+
+installed_version = version('setuptools')
31+
+setuptools_require = '30.3.0'
32+
+assert setuptools_version >= setuptools_require, '{} is required'.format(setuptools_require)
33+
34+
35+
setup(

‎packages/py/python-xlib/package.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# yaml-language-server: $schema=/usr/share/ypkg/schema/schema.json
22
name : python-xlib
33
version : '0.33'
4-
release : 15
4+
release : 16
55
source :
6-
- https://github.com/python-xlib/python-xlib/releases/download/0.33/python-xlib-0.33.tar.gz : 55af7906a2c75ce6cb280a584776080602444f75815a7aff4d287bb2d7018b32
6+
- https://github.com/python-xlib/python-xlib/archive/refs/tags/0.33.tar.gz : e10d1b49655800bffe0fbb5eb31eeef915a4421952ef006d468d53d34901f6f8
77
homepage : https://github.com/python-xlib/python-xlib
88
license : LGPL-2.1-or-later
99
component : programming.python
@@ -18,6 +18,8 @@ builddeps :
1818
- python-setuptools-scm
1919
rundeps :
2020
- python-six
21+
setup : |
22+
%patch -p1 -i ${pkgfiles}/0001-build-Migrate-from-pkg_resources-to-importlib.patch
2123
build : |
2224
%python3_setup
2325
install : |

‎packages/py/python-xlib/pspec_x86_64.xml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<Name>python-xlib</Name>
44
<Homepage>https://github.com/python-xlib/python-xlib</Homepage>
55
<Packager>
6-
<Name>Joey Riches</Name>
7-
<Email>josephriches@gmail.com</Email>
6+
<Name>Evan Maddock</Name>
7+
<Email>maddock.evan@vivaldi.net</Email>
88
</Packager>
99
<License>LGPL-2.1-or-later</License>
1010
<PartOf>programming.python</PartOf>
@@ -215,23 +215,23 @@
215215
<Path fileType="library">/usr/lib/python3.12/site-packages/Xlib/xobject/fontable.py</Path>
216216
<Path fileType="library">/usr/lib/python3.12/site-packages/Xlib/xobject/icccm.py</Path>
217217
<Path fileType="library">/usr/lib/python3.12/site-packages/Xlib/xobject/resource.py</Path>
218-
<Path fileType="library">/usr/lib/python3.12/site-packages/python_xlib-0.33.dist-info/LICENSE</Path>
219218
<Path fileType="library">/usr/lib/python3.12/site-packages/python_xlib-0.33.dist-info/METADATA</Path>
220219
<Path fileType="library">/usr/lib/python3.12/site-packages/python_xlib-0.33.dist-info/RECORD</Path>
221220
<Path fileType="library">/usr/lib/python3.12/site-packages/python_xlib-0.33.dist-info/WHEEL</Path>
221+
<Path fileType="library">/usr/lib/python3.12/site-packages/python_xlib-0.33.dist-info/licenses/LICENSE</Path>
222222
<Path fileType="library">/usr/lib/python3.12/site-packages/python_xlib-0.33.dist-info/top_level.txt</Path>
223223
</Files>
224224
<Replaces>
225225
<Package>python3-xlib</Package>
226226
</Replaces>
227227
</Package>
228228
<History>
229-
<Update release="15">
230-
<Date>2025-06-06</Date>
229+
<Update release="16">
230+
<Date>2026-06-08</Date>
231231
<Version>0.33</Version>
232232
<Comment>Packaging update</Comment>
233-
<Name>Joey Riches</Name>
234-
<Email>josephriches@gmail.com</Email>
233+
<Name>Evan Maddock</Name>
234+
<Email>maddock.evan@vivaldi.net</Email>
235235
</Update>
236236
</History>
237237
</PISI>

0 commit comments

Comments
 (0)