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

Upgrade to CKAN 2.10 #5

Merged
merged 11 commits into from
Aug 9, 2023
Merged

Upgrade to CKAN 2.10 #5

merged 11 commits into from
Aug 9, 2023

Conversation

avdata99
Copy link
Member

@avdata99 avdata99 commented Aug 7, 2023

This PR update this extension to CKAN 2.10

  • Update from bootstrap 4 to bootstrap 5
  • Add CSRF to forms
  • Split tests for CKAN 2.9 and CKAN 2.10
  • Update tests

@@ -11,7 +11,7 @@ <h2>{{ _('Announcements to all users') }}</h2>
role="button"
class="btn btn-primary"
title="Schedule new message"
data-toggle="modal"
data-bs-toggle="modal"
Copy link
Member

Choose a reason for hiding this comment

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

If you are planning on supporting CKAN 2.9 (or CKAN 2.10 running on Bootstrap 3) you need to keep both attributes the new and the old version

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated here 55df8de @amercader

requirements.txt Outdated
@@ -1 +1,3 @@
ckantoolkit
# remove when errors with "packaging" package is fixed
setuptools==65.3.0
Copy link
Member

Choose a reason for hiding this comment

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

This will 100% cause problems down the line, extensions should not touch setuptools. What errors is this trying to fix?

Copy link
Member Author

Choose a reason for hiding this comment

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

The error in the Install requirements test step was

Traceback (most recent call last):
  File "/__w/ckanext-announcements/ckanext-announcements/setup.py", line 2, in 
    from setuptools import setup, find_packages
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 242, in 
    monkey.patch_all()
  File "/usr/lib/python3.10/site-packages/setuptools/monkey.py", line 99, in patch_all
    patch_for_msvc_specialized_compiler()
  File "/usr/lib/python3.10/site-packages/setuptools/monkey.py", line [13](https://github.com/okfn/ckanext-announcements/actions/runs/5788357671/job/15687190753#step:6:14)6, in patch_for_msvc_specialized_compiler
    msvc = import_module('setuptools.msvc')
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/usr/lib/python3.10/site-packages/setuptools/msvc.py", line 32, in 
    from packaging.version import LegacyVersion
ImportError: cannot import name 'LegacyVersion' from 'packaging.version'  (/usr/lib/python3.10/site-packages/packaging/version.py)

@amercader What do you think of moving this fix to tests? dec5378

@@ -35,3 +35,8 @@ def get_all_announcements():
)

return messages


def get_user_env(user_dict):
Copy link
Member

Choose a reason for hiding this comment

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

If this (really scary) function is only used in tests add it to the relevant test module and not the public helpers

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated here 4a08aeb and finally removed the helper here 95e68f9 @amercader

@avdata99 avdata99 requested a review from amercader August 9, 2023 13:14
@avdata99 avdata99 merged commit 20be87a into main Aug 9, 2023
6 checks passed
@avdata99 avdata99 deleted the to_ckan_2.10 branch August 9, 2023 14:55
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