Closed kloczek closed 2 years ago
Unfortunately, there's no importlib
replacement for declare_namespace
. That technique is part of how sphinx
has specified the namespace for contrib packages. The only way to eliminate that usage of pkg_resources is to switch to a different technique for namespace packages. Sadly, that will require a coordinated effort of all authors of sphinxcontrib
packages and likely backward-incompatible transition because pkg_resource
-style namespace packages are incompatible with pkgutil
-style and native namespace packages.
I did this same transition with the jaraco
namespace in early 2019. The good news is that it was mostly painless, but I also was able to update all the packages in a short period (days/weeks), so any compatibility issues that might have arisen would have been minimized.
Your best bet would be to contact the Sphinx maintainers and see if they have any plans to migrate to pkgutil or native namespace packages.
See the docs on namespace packages.
I wish I had a better answer, but I don't think there's anything that importlib can do to help here.
I really appreciate all those details. Thank you very much for your time😃
I'm trying to get rid of usage 'pkg_resources` packages.
All those packages have in source tree something like
in all
sphinxcontrib-I cannot figure out how to replace that to use
importlib_metadata
. May I ask for help? 🤔