removing use of pkg_resources to improve command line app performance

Jeremy Stanley fungi at yuggoth.org
Mon Jul 6 19:29:24 UTC 2020


On 2020-07-06 15:21:06 -0400 (-0400), Doug Hellmann wrote:
[...]
> I neglected to mention that there are uses of pkg_resources
> outside of OpenStack code in libraries used by
> python-openstackclient. I found a use in dogpile and another in
> cmd2. I haven’t started working on patches to those, yet. If
> someone wants to do a more extensive search that would be very
> helpful. I started an etherpad to keep track of the work that’s in
> progress: https://etherpad.opendev.org/p/osc-performance

Looking at some other uses of pkg_resources, seems like this would
be the new way to get the abbreviated Git commit ID stored by PBR:

    json.loads(
        importlib.metadata.distribution(packagename).read_text('pbr.json')
        )['git_version']

-- 
Jeremy Stanley
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20200706/f506a28f/attachment.sig>


More information about the openstack-discuss mailing list