Skip to content

Remove dependency on pkg_resources #127

@sbidoul

Description

@sbidoul

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions