Repository navigation
fix: compatibility with setuptools>=82 (no pkg_resources) - #8
Merged
paulmueller merged 1 commit intoNov 3, 2026
Merged
Conversation
CKAN 2.11.6 ships setuptools 84, which does not contain `pkg_resources` anymore. Use the same namespace declaration in `ckanext/__init__.py` as CKAN does and replace any other `pkg_resources` usage with `importlib.resources`. Add a test that imports the plugin without `pkg_resources`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Required for the upgrade of DCOR instances from CKAN 2.11.5 to 2.11.6.
Problem
The CKAN 2.11.6 package (
python-ckan_2.11-noble_amd64.deb) ships setuptools 84.0.0, which no longer containspkg_resources(CKAN 2.11.6 changelog: "Removed setuptools upper limit requirement"). I verified this by installing CKAN 2.11.6 in an environment that uses the site-packages of that package. With the currentmaster, importing the plugins of ckanext-dcor_schemas, ckanext-dcor_depot and ckanext-dcor_theme fails withModuleNotFoundError: No module named 'pkg_resources', so CKAN would not start with the DCOR plugins.The extension CI did not catch this: the
ckan/ckan-dev:2.11image already runs CKAN 2.11.6, but it still ships an older setuptools withpkg_resources.Changes
ckanext/__init__.py: the same namespace declaration that CKAN 2.11.6 uses itself. It still usespkg_resourceswhen available and falls back topkgutil.extend_pathotherwise.pkg_resourcesusage)tests/test_setuptools.py: imports the plugin in a subprocess withpkg_resourcesblocked (sys.modules['pkg_resources'] = None), independent of the setuptools version in the CI image.Verification
In an environment with CKAN 2.11.6 and setuptools 84 (the site-packages of the 2.11.6 package), with all six DCOR extensions installed editable:
dcor_schemas,dcor_depotincl. CLI,dcor_themeincl. CLI,dc_serve,dc_view,dc_log_view)ckan.potand CKAN'smain.cssare foundmaster(for dcor_schemas, dcor_depot and dcor_theme)Same change in all six extensions: ckanext-dcor_schemas, ckanext-dcor_depot, ckanext-dcor_theme, ckanext-dc_serve, ckanext-dc_view, ckanext-dc_log_view. They are independent of each other, but all of them need a release before production can be upgraded to CKAN 2.11.6.
🤖 Generated with Claude Code