Skip to content
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

QOL-9055 add Python 3 to CI testing and fix compatibility #72

Merged
merged 10 commits into from
Jul 18, 2022

Conversation

ThrawnCA
Copy link

  • Add Github Actions run for Python 3
  • Replace Fanstatic with Webassets on CKAN 2.9+
  • Replace deprecated 'cgi.escape' if 'html.escape' is available
  • Fix Flask routing for dataset reads

- we need to be consistent about using the 'ckan-' prefix or not, but it's more flexible not to assume it
- 'html.escape' appears to be available on Py2 as well, so we can use that
- Use Fanstatic for older CKAN, Webassets for CKAN 2.9+
- use 'dataset.read' not 'package.read', and use 'dataset_read' on older CKAN
cmd: |
docker cp . $(docker-compose ps -q ckan):/app/
docker cp .docker/scripts/ckan_cli $(docker-compose ps -q ckan):/app/ckan/default/bin/
ahoy cli 'chmod u+x $VENV_DIR/bin/ckan_cli; cp .docker/test.ini $CKAN_INI'
Copy link
Member

Choose a reason for hiding this comment

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

why mix, doesn't docker have a cli interface also under the ahoy hood?

Copy link
Author

Choose a reason for hiding this comment

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

The Ahoy task takes care of identifying the 'ckan' container. It's not a big deal, but it already exists, so may as well use it.

ckan-version: [ckan-2.8.8, ckan-2.9.5]
python-version: [py2, py3]
exclude:
- ckan-version: ckan-2.8.8
Copy link
Member

Choose a reason for hiding this comment

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

nice

@@ -0,0 +1,15 @@
edit_comments-js:
Copy link
Member

Choose a reason for hiding this comment

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

how does this work, link to doc's for others to learn also please

Copy link
Author

Choose a reason for hiding this comment

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

@@ -54,13 +54,13 @@ def get_blueprint(self):
('GET', 'POST',),
),
(
"/{}/follow/<datarequest_id>".format(constants.DATAREQUESTS_MAIN_PATH),
"/{}/follow/<id>".format(constants.DATAREQUESTS_MAIN_PATH),
Copy link
Member

Choose a reason for hiding this comment

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

isn't id too generic, why did we need to shrink it?

Copy link
Author

Choose a reason for hiding this comment

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

It has to match what's actually used in the page, otherwise there's an error. We could change it, but would then also need to change the Pylons routing, which just uses 'id'.

@@ -39,7 +40,7 @@ <h3>{{ _('Additional Info') }}</h3>
<tr>
<th scope="row" class="dataset-label">{{ _('Accepted dataset') }}</th>
<td class="dataset-details">
{% link_for datarequest.accepted_dataset['title'], named_route='package.read', id=datarequest.accepted_dataset.get('id') %}
{% link_for datarequest.accepted_dataset['title'], named_route=dataset_read_route, id=datarequest.accepted_dataset.get('id') %}
Copy link
Member

Choose a reason for hiding this comment

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

did we miss this?

Copy link
Author

Choose a reason for hiding this comment

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

Looks like yes.

@ThrawnCA ThrawnCA merged commit d37ba4e into develop Jul 18, 2022
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.

None yet

2 participants