Switch from pkg_resources to importlib/packaging.

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

Information

RBTools
release-5.x

Reviewers

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 ID
Switch from pkg_resources to importlib/packaging.
`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.
9534a7351a12e3cf43f07ea2027d31c6ddf31440
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
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.x (3fa65df)