Switch from pkg_resources to importlib/packaging.

Review Request #13067 — Created May 25, 2023 and updated

chipx86
RBTools
release-5.x
rbtools

pkg_resources is deprecated, and not long for this world. To modernize
our code, we now use importlib (specifically, the importlib_metadata
and importlib_resources compatibility modules) and packaging.

These aren't one-to-one replacements for pkg_resources, but porting
was pretty minimal. For the purposes of RBTools, the new APIs give us
everything we need to look up entrypoints, fetch resource files, and
compare versions.

Tested running built-in RBTools commands, aliases, entrypoint-based
third-party commands, and commands in the search path starting with
rbt-.

Tested generating command line completion scripts.

Tested version parsing for all our flavors of version identifiers
provided throughout Review Board history (old-school 1.0alpha1
through modern 6.0b2).

Summary
Switch from pkg_resources to importlib/packaging.
Description From Last Updated

'typing.Iterable' imported but unused Column: 1 Error code: F401

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
Review request changed

Change Summary:

Removed an unused import.

Commits:

Summary
-
Switch from pkg_resources to importlib/packaging.
+
Switch from pkg_resources to importlib/packaging.

Diff:

Revision 2 (+226 -82)

Show changes

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
Loading...