AlexisBRENON / ewmh_m2m

EWMH-compliant move to monitor utility
https://pypi.org/project/ewmh-m2m/
MIT License
90 stars 5 forks source link

pkg_resources is deprecated as an API #28

Closed wahlflo closed 3 months ago

wahlflo commented 9 months ago

I received the following error on a new system where the package setuptools was not installed yet:

[root@laptop gits]# move-to-monitor
Traceback (most recent call last):
  File "/usr/bin/move-to-monitor", line 5, in <module>
    from ewmh_m2m.__main__ import main
  File "/usr/lib/python3.11/site-packages/ewmh_m2m/__init__.py", line 2, in <module>
    from pkg_resources import get_distribution, DistributionNotFound
ModuleNotFoundError: No module named 'pkg_resources'

After installing setuptools the pkg_resourcespackage was available but it is still deprecated

[root@laptop gits]# python3
Python 3.11.5 (main, Sep  2 2023, 14:16:33) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkg_resources
<stdin>:1: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html

So, one issue is that setuptools is missing as dependency. But one should also replace the usage of the package pkg_resources.

wahlflo commented 9 months ago

addressed by pull request: https://github.com/AlexisBRENON/ewmh_m2m/pull/29