Switch from pkg_resources to importlib/packaging.
Review Request #13067 — Created May 25, 2023 and submitted — Latest diff uploaded
pkg_resources
is deprecated, and not long for this world. To modernize
our code, we now useimportlib
(specifically, theimportlib_metadata
andimportlib_resources
compatibility modules) andpackaging
.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-school1.0alpha1
through modern6.0b2
).