-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to CKAN 2.9.4 & python 3.7 #8
Comments
mdutoo
added a commit
that referenced
this issue
Dec 6, 2021
This was referenced Dec 6, 2021
mdutoo
added a commit
to ozwillo/ckanext-resource-location
that referenced
this issue
Dec 6, 2021
mdutoo
added a commit
to ozwillo/ckanext-mapviews
that referenced
this issue
Dec 6, 2021
mdutoo
added a commit
to ozwillo/ckanext-datarequests
that referenced
this issue
Dec 6, 2021
mdutoo
added a commit
to ozwillo/ckanext-datarequests
that referenced
this issue
Dec 6, 2021
mdutoo
added a commit
to ozwillo/ckanext-dashboard
that referenced
this issue
Dec 6, 2021
mdutoo
added a commit
to ozwillo/ckanext-mapviews
that referenced
this issue
May 18, 2022
- following process at ozwillo/ckanext-ozwillo-theme#8 - patched imports : config, urlparse - moved to webassets instead of fanstatic (save for IE conditional vendor/excanvas.js)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In this issue is aggregated all best practices and errors & patches encountered in migrating all CKAN extensions, since ckanext-ozwillo-theme is the most specific Ozwillo CKAN extension.
Migration overview
Process
see also :
https://github.com/ckan/ckan/wiki/Python-3-migration-guide-for-extensions
Python 3 support ckan/ckan#4681
Flask and Python 3 support on selected extension ckan/ckan#4793
https://docs.ckan.org/en/2.9/maintaining/upgrading/upgrade-to-python3.html
(old) Flask and Python 3 support on selected extensions ckan/ckan#4793
Below are common migration errors and patches.
CKAN static resources are handled by webassets rather than fanstatic
NB. migrating to latest CKAN HTML (and especially Bootstrap 3) still remains to be done : #2
see https://docs.ckan.org/en/2.9/theming/webassets.html
add webassets.yml config https://docs.ckan.org/en/2.9/contributing/frontend/assets.html
reimports : see ckan/ckan/public/base/javascript/webassets.yml ckan/ckan/public/base/javascript/webassets.yml
Example:
webassets https://github.com/ozwillo/ckanext-ozwillo-theme/blob/master/ckanext/ozwillo_theme/assets/webassets.yml
as required by 3b51e2a
see also :
ckan/ckan@4a0ff5c
obsolete https://docs.ckan.org/en/2.8/theming/fanstatic.html
obsolete : https://docs.ckan.org/en/2.8/contributing/frontend/resources.html
CKAN uses Flask web framework instead of Pylons
Pylons config is moved to the compatibility toolkit, as is ckan.logic :
Pylons Controllers (& their routes) become Flask blueprint.py :
see also :
ckan/ckan#4791
https://docs.ckan.org/en/2.9/extensions/flask-migration.html
https://github.com/ckan/ckan/wiki/Migration-from-Pylons-to-Flask
Flask routes : https://flask.palletsprojects.com/en/2.0.x/api/
https://docs.ckan.org/en/2.9/extensions/plugins-toolkit.html
CKAN nore mode model.new_revision()
vi ckanext-ozwillo-organization-api/ckanext/ozwillo_organization_api/plugin.py # no model.repo.new_revision() in 2.9 like in 2.8.2, see ckan/action/create.py diff & https://pythonrepo.com/repo/ckan-ckan-python-science
CKAN dataset API change
werkzeug.routing.BuildError: Could not build url for endpoint 'package.read' with values ['id']. Did you mean 'dataset.read' instead?
=>
package becomes dataset :
{{ h.link_to(h.truncate(title, truncate_title), h.url_for(controller='package', action='read', id=package.name)) }}
becomes
{{ h.link_to(h.truncate(title, truncate_title), h.url_for('%s.read' % package.type, id=package.name)) }}
in
ckanext/ozwillo_theme/templates/base.html
ckanext/ozwillo_theme/templates/home/snippets/dataset_bloc.html
ckanext/ozwillo_theme/templates/package/snippets/package_basic_fields.html
ckanext/ozwillo_theme/templates/package/snippets/package_form.html
ckanext/ozwillo_theme/templates/page.html
ckanext/ozwillo_theme/templates/snippets/package_item.html
Example :
find . -name "." -exec grep "dataset_read" {} ; -print
dataset_url = url_for('dataset_read',
./ckanext-dcat/ckanext/dcat/profiles.py
_map.connect('dataset_read', '/dataset/{_id}',
./ckanext-dcat/ckanext/dcat/plugins/pylons_plugin.py
Python2/3 Import syntax
Python2/3 Exceptions syntax
Python2/3 unicode type becomes str
The text was updated successfully, but these errors were encountered: