Skip to content

Commit

Permalink
Merge pull request #74 from ckan/ckan-2.11-support
Browse files Browse the repository at this point in the history
CKAN v2.11 support
  • Loading branch information
smotornyuk authored Jun 28, 2024
2 parents 09ec707 + 0dedda1 commit 44cb284
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ jobs:
needs: lint
strategy:
matrix:
ckan-version: ["2.10", 2.9, 2.9-py2, 2.8]
ckan-version: ["2.11", "2.10", 2.9]
fail-fast: false

name: CKAN ${{ matrix.ckan-version }}
runs-on: ubuntu-latest
container:
image: openknowledge/ckan-dev:${{ matrix.ckan-version }}
image: ckan/ckan-dev:${{ matrix.ckan-version }}
services:
solr:
image: ckan/ckan-solr:${{ matrix.ckan-version }}
image: ckan/ckan-solr:${{ matrix.ckan-version }}-solr9
postgres:
image: ckan/ckan-postgres-dev:${{ matrix.ckan-version }}
env:
Expand All @@ -54,22 +54,16 @@ jobs:
# Replace default path to CKAN core config file with the one on the container
sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' test.ini
- name: Setup extension (CKAN 2.10)
if: ${{ matrix.ckan-version == '2.10' }}
if: ${{ matrix.ckan-version >= '2.10' }}
run: |
pip install -r dev-requirements.txt
ckan -c test.ini db init
ckan -c test.ini db upgrade -p googleanalytics
- name: Setup extension (CKAN == 2.9)
if: ${{ matrix.ckan-version == '2.9' || matrix.ckan-version == '2.9-py2' }}
if: ${{ matrix.ckan-version == '2.9' }}
run: |
pip install -r dev-requirements-2.9.txt
ckan -c test.ini db init
ckan -c test.ini db upgrade -p googleanalytics
- name: Setup extension (CKAN < 2.9)
if: ${{ matrix.ckan-version == '2.8' }}
run: |
pip install -r dev-requirements-2.9.txt
paster --plugin=ckan db init -c test.ini
paster --plugin=ckanext-googleanalytics initdb -c test.ini
- name: Run tests
run: pytest --ckan-ini=test.ini --cov=ckanext.googleanalytics --disable-warnings ckanext/googleanalytics/tests
2 changes: 1 addition & 1 deletion ckanext/googleanalytics/tests/test_plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest


@pytest.mark.usefixtures("clean_db")
@pytest.mark.usefixtures("with_plugins", "clean_db")
def test_script(app):
resp = app.get("/")
assert "GoogleAnalyticsObject" in resp
4 changes: 2 additions & 2 deletions ckanext/googleanalytics/tests/test_view.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest

import six
import ckan.plugins.toolkit as tk
from ckanext.googleanalytics import config

Expand All @@ -23,4 +23,4 @@ def test_tracking_(self, mode, tracking_id, app, ckan_config, monkeypatch):
monkeypatch.setitem(ckan_config, config.CONFIG_TRACKING_MODE, mode)
snippet = _render_header(mode, tracking_id)
resp = app.get("/about")
assert snippet in resp.body
assert six.ensure_str(snippet) in resp
7 changes: 4 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = ckanext-googleanalytics
version = 2.3.0
version = 2.4.0
description = Add GA tracking and reporting to CKAN instance
long_description = file: README.md
long_description_content_type = text/markdown
Expand All @@ -11,16 +11,17 @@ license = AGPL
classifiers =
Development Status :: 4 - Beta
License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
keywords =
CKAN

[options]
# python_requires = >= 3.7
python_requires = >= 3.7
install_requires =
ckantoolkit
google-api-python-client
Expand Down

0 comments on commit 44cb284

Please sign in to comment.