ckan icon indicating copy to clipboard operation
ckan copied to clipboard

Replace usage of pkg_resources.iter_entry_points, update exception message

Open amercader opened this issue 7 months ago • 1 comments

pkg_resources is deprecated and to be removed soon, replace it with importlib.metadata instead. :

UserWarning: pkg_resources is deprecated as an API. See
https://setuptools.pypa.io/en/latest/pkg_resources.html. The
pkg_resources package is slated for removal as early as 2025-11-30.
Refrain from using this package or pin to Setuptools<81.

While working on that code, I never liked this exception message when trying to load an non-existent plugin:

  File "/home/adria/dev/projects/ckan-py310/ckan/ckan/plugins/core.py", line 250, in _get_service
    raise PluginNotFoundException(plugin_name)
ckan.plugins.base.PluginNotFoundException: Interface dcat does not exist

So I updated the message:

  File "/home/adria/dev/projects/ckan-py310/ckan/ckan/plugins/core.py", line 250, in _get_service
    raise PluginNotFoundException(plugin_name)
ckan.plugins.base.PluginNotFoundException: Plugin 'dcat' not found.

Did you install the 'ckanext-*' Python package that contains the plugin?

amercader avatar Jun 10 '25 14:06 amercader

The changes are not compatible with Python 3.9. Waiting on https://github.com/ckan/ckan/issues/8994 to update the workflows

amercader avatar Jun 12 '25 10:06 amercader

Typing errors will be fixed when https://github.com/ckan/ckan/pull/8995 is merged

amercader avatar Jun 23 '25 09:06 amercader

:x: Unsupported file format

Upload processing failed due to unsupported file format. Please review the parser error message:
Error deserializing json

Caused by: expected value at line 1 column 1

For more help, visit our troubleshooting guide.

codecov[bot] avatar Jun 27 '25 13:06 codecov[bot]

@wardi Not sure what codecov is going on about, but this is ready to go

amercader avatar Jun 30 '25 12:06 amercader

Backport failed for dev-v2.11, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin dev-v2.11
git worktree add -d .worktree/backport-8992-to-dev-v2.11 origin/dev-v2.11
cd .worktree/backport-8992-to-dev-v2.11
git switch --create backport-8992-to-dev-v2.11
git cherry-pick -x e17ff328c87c3967c1f2aa2be8199ce4c44c92b9 6a1a513a13e3d89b84084ddd29926d8b83b97cf6 7c0c04b2ccc10f462b4979b50c225edd930ae1b2 beb3ba6845158fa5dd82b81a1d3eddd292fd8ae1 b81cac761585ca0860ebcb3df2b60a5e852a3fba 8d037744f0a842fd0247926804ebd5cb7bd85298

ckanbot avatar Jun 30 '25 13:06 ckanbot

Backport failed for dev-v2.10, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin dev-v2.10
git worktree add -d .worktree/backport-8992-to-dev-v2.10 origin/dev-v2.10
cd .worktree/backport-8992-to-dev-v2.10
git switch --create backport-8992-to-dev-v2.10
git cherry-pick -x e17ff328c87c3967c1f2aa2be8199ce4c44c92b9 6a1a513a13e3d89b84084ddd29926d8b83b97cf6 7c0c04b2ccc10f462b4979b50c225edd930ae1b2 beb3ba6845158fa5dd82b81a1d3eddd292fd8ae1 b81cac761585ca0860ebcb3df2b60a5e852a3fba 8d037744f0a842fd0247926804ebd5cb7bd85298

ckanbot avatar Jun 30 '25 13:06 ckanbot

2.11 version is here: https://github.com/ckan/ckan/pull/9013. On 2.10 the plugins code was too different to apply the patches.

amercader avatar Jul 03 '25 11:07 amercader