Closed kentsanggds closed 2 years ago
Now that 2.9 has been released, is there any update on this?
do you have an update or an estimate when this will be done? thank you!
Sorry for the extreme delay in getting back to you all on this one. As you can see, @ThrawnCA has made the first inroads into Python 3 compat, and it seems that there will be effort going into upgrading this plugin to work with CKAN 2.9 in the not too distant future. I can't give specific timelines unfortunately, but we're also happy for community contributions if anyone else is keen to help out :)
Based on my recent experience, what needs to happen is basically:
Pull all the functions in controllers.py
up to the module level instead of having them in a class (could probably keep the class, but just fill it with pointers to the functions).
Add functions that will construct Flask Blueprints at /user
, /mfa_configure
, and /api/mfa_login
, something like:
secure_user = Blueprint(
u'secure_user',
__name__,
url_prefix=u'/user'
)
Translate the rules in before_map
and after_map
to Blueprint URL rules, eg
urlmap.connect('/user/reset/{id:.*}', controller=userController, action='perform_reset')
might become
secure_user.add_url_rule('/reset/<id>', view_func=perform_reset)
plugins.IBlueprint
in the plugin and stop implementing IRoutes
. For broader compatibility, use plugins.toolkit.check_ckan_version(min_version='2.8.0')
to determine which one to implement.get_blueprint
function and return a list of all the blueprints to use.This extension now supports Python 3 and CKAN 2.9.x and is in active use on https://catalogue.data.govt.nz
Please let us know if you find any issues with it :+1:
I'm the tech lead for datagovuk and we're in the middle of upgrading our stack from 2.7 to 2.9 now that python 2 has reached EOL.
We are thinking of using your extension as part of the upgrade work but before we do, it would be good to know if you have plans to upgrade to flask and python 3 and what the schedule looks like roughly?