setuptools 82 removed pkg_resources. #125 helps with that. uv however does not select setuptools-odoo 3.3.2 (see #126 (comment)) so although workaround exist (see #126 (comment)), we may want to stop relying on pkg_resources.
We have these build-time uses:
pkg_resources.parse_version in git_postversion.py: we can replace with packaging.version
pkg_resources.resource_string in base_addons.py: we can replace with stdlib importlib.resources (need to check compatible python versions)
We use it in tests (can be replaced in a second time, or not at all because we'll still need pkg_resources in test addons):
pkg_resources.find_distributions: we can replace with stdlib importlib.metadata (need to check compatible python versions)
At runtime on older Odoo versions we have __import__('pkg_resources').declare_namespace(__name__) in __init__.py but these Odoo versions need pkg_resources at runtime too so that is not an issue.
All in all, still a bit of work, though.
setuptools 82 removed
pkg_resources. #125 helps with that.uvhowever does not select setuptools-odoo 3.3.2 (see #126 (comment)) so although workaround exist (see #126 (comment)), we may want to stop relying onpkg_resources.We have these build-time uses:
pkg_resources.parse_versioningit_postversion.py: we can replace withpackaging.versionpkg_resources.resource_stringinbase_addons.py: we can replace with stdlibimportlib.resources(need to check compatible python versions)We use it in tests (can be replaced in a second time, or not at all because we'll still need pkg_resources in test addons):
pkg_resources.find_distributions: we can replace with stdlibimportlib.metadata(need to check compatible python versions)At runtime on older Odoo versions we have
__import__('pkg_resources').declare_namespace(__name__)in__init__.pybut these Odoo versions needpkg_resourcesat runtime too so that is not an issue.All in all, still a bit of work, though.