Switch from pkg_resources to importlib/packaging.

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

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).

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2

Commits

First Last Summary ID Author
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.
a16087f8b40b4d3c3c349a54ea116e5041e3cf4a Christian Hammond
setup.py
rbtools/api/resource.py
rbtools/commands/__init__.py
rbtools/commands/main.py
rbtools/commands/setup_completion.py
Loading...