Skip to content

Upgrade to Python 3.10 for CKAN 2.11 compatibility#172

Draft
A-Souhei wants to merge 26 commits intodevelopmentfrom
ckan211-python310-migration-staging-1
Draft

Upgrade to Python 3.10 for CKAN 2.11 compatibility#172
A-Souhei wants to merge 26 commits intodevelopmentfrom
ckan211-python310-migration-staging-1

Conversation

@A-Souhei
Copy link
Contributor

@A-Souhei A-Souhei commented Jan 10, 2026

Summary

This PR upgrades the Python version from 3.8 to 3.10 to support CKAN 2.11.4 which requires Python >= 3.9.

Changes

Dockerfile

  • Updated base image from python:3.8 to python:3.10

Pipfile & Pipfile.lock

Updated package versions to be compatible with Python 3.10 and CKAN 2.11:

Package Old Version New Version
flask ~1.1.1 3.0.3
flask-babel 1.0.0 4.0.0
jinja2 2.10.1 3.1.6
werkzeug 1.0.0 3.0.6
sqlalchemy 1.3.5 1.4.52
redis 3.5.3 5.0.7
alembic 1.0.0 1.13.2
cryptography ~3.4.7 >=41.0.0
pyopenssl ~18.0.0 >=23.2.0

bootstrap.sh

  • Added runtime fix for ckanext-authz-service Python 3.10 compatibility (collections.Iterablecollections.abc.Iterable)

Submodules

  • ckanext-validation: Removed markupsafe==2.0.1 pin that conflicted with CKAN 2.11 requirements

Notes

A few images need upgrades:

  • ghcr.io/fjelltopp/adx_develop/ckan_base:${CKAN_IMAGE_TAG}
  • fjelltopp/python-fjelltopp-base:3.8
  • postgres:12-bullseye
  • giftless
  • submodules are checked out to those who have been fixed

- Update Dockerfile base image from python:3.8 to python:3.10
- Update Pipfile and Pipfile.lock with Python 3.10 compatible packages
- Add Python 3.10 compatibility fix for ckanext-authz-service in bootstrap.sh
- Update ckanext-validation submodule (removed markupsafe pin)
@A-Souhei A-Souhei requested a review from cooper667 January 10, 2026 15:18
@A-Souhei
Copy link
Contributor Author

@cooper667 @ChasNelson1990
Now it works but with bugs:
image

I created a few issues in https://github.com/fjelltopp/adx_develop/issues, I will continue working on them but I pushed the changes for our staging.

Pipfile.lock Outdated
"sha256:fb1461c99de4d040666ca0444057b06541e5642f800b71c56e6ea92d6a853a0c"
],
"index": "pypi",
"markers": "python_version >= '3.11'",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails for me as needs py 3.11

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have a look at it soon.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry about it for now, I've handled it

- Pin numpy==1.24.4 and pandas==1.5.3 to fix version mismatch error
- Remove saml2auth from plugins list in adx_config.ini
- Comment out SAML2 configuration settings
- Update ckanext-unaids to remove login_register_catch blueprint
- Add ckan.datapusher.callback_url_base = http://ckan:5000
- Update ckanext-unaids submodule with Data Explorer fix
- Add ckanext-geoview v0.3.1 as submodule for GeoJSON/WMS map visualization
- Enable geo_view and geojson_view plugins in CKAN config
- Add geojson_view to default views for auto-creation on GeoJSON resources
- Update Pipfile and lock with new dependency
ckanext-blob-storage:
- Fix CKAN 2.11 resource download route conflict
- Fix flake8 lint issues

ckanext-scheming:
- Fix duplicate scheming.presets config declaration error
- Add IConfigDeclaration for CKAN 2.11 compatibility
- Fix badge class and package_search user context
Updated submodules with CKAN 2.11 compatibility fixes:
- ckanext-scheming: url_for helper for resource links
- ckanext-unaids: Bootstrap 5 templates, helpers cleanup
- ckanext-harvest: route name updates (harvester.*)
- ckanext-dhis2harvester: Bootstrap 5, routes, DHIS2 API fallback
- Add saml2auth back to plugins list in adx_config.ini
- Uncomment SAML2 configuration settings
- Update ckanext-saml2auth with Flask 3.x ava serialization fix
- Update ckanext-unaids with login_register_catch blueprint re-enabled
- Update numpy to 1.26.4 (last 1.x version compatible with Python 3.10)
- Update pandas to 2.0.3 (compatible with numpy 1.26.4)
- Update ckanext-unaids submodule with matching pandas version
- Resolves: ImportError: No module named 'numpy.lib.histograms'

The error occurred because pandas 2.2.0 requires numpy.lib.histograms,
which was removed in numpy 2.0. This pins both packages to compatible
versions that work with Python 3.10.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments