hughsie / libgusb

GUsb is a GObject wrapper for libusb1
GNU Lesser General Public License v2.1
25 stars 21 forks source link

Version parsing moved to a separate Python package #61

Closed mcepl closed 2 years ago

mcepl commented 2 years ago

When running build of the package in openSUSE/Factory with Python 3.10 we hit the crash, because pkg_resources package have been removed from the standard library and the functionality moved to the external packaging package on PyPI.

This patch fixes the issue.

bnavigator commented 2 years ago

-standard library +setuptools

mcepl commented 2 years ago

-standard library +setuptools

Could you elaborate a little bit, please?

bnavigator commented 2 years ago

https://build.opensuse.org/request/show/993338

  • pkg_resources is provided by setuptools, but the previously transitive pull in of setuptools has been broken by gtk-doc --> python3-Pygments -/-> python3-setuptools

https://build.opensuse.org/request/show/993312#comment-1659321

pkg_resources is a (deprecated) part of setuptools and the reason it failed is because gtk-doc requires Pygments which had setuptools as requirement but does not have it anymore.

https://setuptools.pypa.io/en/latest/pkg_resources.html

The pkg_resources module distributed with setuptools provides an API for Python libraries to access their resource files, and for extensible applications and frameworks to automatically discover plugins. It also provides runtime support for using C extensions that are inside zipfile-format eggs, support for merging packages that have separately-distributed modules or subpackages, and APIs for managing Python’s current “working set” of active packages.

Use of pkg_resources is discouraged in favor of importlib.resources, importlib.metadata, and their backports (importlib_resources, importlib_metadata). Please consider using those libraries instead of pkg_resources.

This has nothing to do with the standard library of python 3.10 or any previous python versions.

mcepl commented 2 years ago

OK, so what do you suggest we should do here?

bnavigator commented 2 years ago

Nothing. It was a packaging error on the openSUSE side and has been fixed.

A simple BuildRequires: python3-setuptools would have been enough. In fact I had that prepared but my submission failed due to a race condition with your submission.

The patch works and doesn't harm, but is not as pressing as your initial description would imply. Current setuptools still ships pkg_resources and does not throw DeprecationWarnings unless you are feeding it invalid versions (LegacyVersion) AFAICT.