Replace discouraged pkg_resources for Python 3.9+

See https://setuptools.readthedocs.io/en/latest/pkg_resources.html
2 jobs for master in 7 minutes and 8 seconds (queued for 1 second)
Status Job ID Name Coverage
  Test
passed #22510
code-quality

00:05:26

3.0%
 
  Build
passed #22513
windows

00:01:42