Polyconseil / zbarlight

A simple wrapper for zbar
BSD 3-Clause "New" or "Revised" License
163 stars 37 forks source link

`pkg_resources` is deprecated #38

Open The-Compiler opened 1 year ago

The-Compiler commented 1 year ago

With Python 3.11, python3 -Wall -c "import zbarlight" results in:

.../python3.11/site-packages/zbarlight/__init__.py:3: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources

Assuming support for Python < 3.8 is dropped (those all are out of support anyways), the current usage can be changed to:

from importlib import metadata
__version__ = metadata.version('zbarlight')
KIC commented 4 months ago

Now with 3.12 definitely fails with

39