You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
setuptools 67 deprecated pkg_resource, and in 82 it was removed, leading to:
* Building wheel...
Traceback (most recent call last):
File "/opt/pkg/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
main()
File "/opt/pkg/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pkg/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
return _build_backend().build_wheel(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pkg/lib/python3.11/site-packages/setuptools/build_meta.py", line 438, in build_wheel
return _build(['bdist_wheel'])
^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pkg/lib/python3.11/site-packages/setuptools/build_meta.py", line 429, in _build
return self._build_with_temp_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pkg/lib/python3.11/site-packages/setuptools/build_meta.py", line 410, in _build_with_temp_dir
self.run_setup()
File "/opt/pkg/lib/python3.11/site-packages/setuptools/build_meta.py", line 520, in run_setup
super().run_setup(setup_script=setup_script)
File "/opt/pkg/lib/python3.11/site-packages/setuptools/build_meta.py", line 317, in run_setup
exec(code, locals())
File "<string>", line 3, in <module>
ModuleNotFoundError: No module named 'pkg_resources'
when trying to build it.
Workaround:
--- setup.py.orig 2026-02-17 15:06:10.418245753 +0000
+++ setup.py
@@ -1,12 +1,9 @@
# Distutils script for python-xlib
-from pkg_resources import parse_requirements
from setuptools import (__version__ as setuptools_version, setup)
# Check setuptools is recent enough to support `setup.cfg`.
-setuptools_require = next(parse_requirements('setuptools>=30.3.0'))
-assert setuptools_version in setuptools_require, '{} is required'.format(setuptools_require)
setup(
Sure, preserving the check is nicer.
I'm not interested in Python 2.7 compatibility.
I didn't touch runtests.py because I use pytest to run the tests, that seems to work fine, so I didn't notice.
But please go ahead and commit your versions!
Thanks.
Activity
loqs commentedon Feb 24, 2026
@0-wiz-0 Have you considered preserving the version check for backwards compatibility possible:
Or attempt to preserve compatibility back to python 2.7:
What did you do for runtests.py?
0-wiz-0 commentedon Feb 25, 2026
Sure, preserving the check is nicer.
I'm not interested in Python 2.7 compatibility.
I didn't touch runtests.py because I use
pytestto run the tests, that seems to work fine, so I didn't notice.But please go ahead and commit your versions!
Thanks.