From 13182ae3162c2a50be0b9ca1591d75d7de65d655 Mon Sep 17 00:00:00 2001 From: Lloyd Dakin Date: Fri, 6 Sep 2024 11:45:57 -0700 Subject: [PATCH 1/4] find_module deprecated in 3.12 replacing with import_module --- datalab/datalab_session/data_operations/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datalab/datalab_session/data_operations/utils.py b/datalab/datalab_session/data_operations/utils.py index a3bf4c1..13d103d 100644 --- a/datalab/datalab_session/data_operations/utils.py +++ b/datalab/datalab_session/data_operations/utils.py @@ -1,5 +1,6 @@ from pkgutil import walk_packages import inspect +from importlib import import_module from django.utils.module_loading import import_string from datalab.datalab_session import data_operations @@ -8,7 +9,7 @@ def available_operations(): operations = {} base_operation = import_string('datalab.datalab_session.data_operations.data_operation.BaseDataOperation') for (loader, module_name, _) in walk_packages(data_operations.__path__): - module = loader.find_module(module_name).load_module() + module = import_module(f'{data_operations.__name__}.{module_name}') members = inspect.getmembers(module, inspect.isclass) for member in members: if member[0] != 'BaseDataOperation' and issubclass(member[1], base_operation): From 0c2538ed1f6a98c24042027a0dda15a6faa20e78 Mon Sep 17 00:00:00 2001 From: Lloyd Dakin Date: Fri, 6 Sep 2024 11:52:35 -0700 Subject: [PATCH 2/4] matrix tests for 3.10-3.12 --- .github/workflows/django-test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/django-test.yml b/.github/workflows/django-test.yml index 6f2b937..d0b5804 100644 --- a/.github/workflows/django-test.yml +++ b/.github/workflows/django-test.yml @@ -9,6 +9,9 @@ jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12"] steps: - name: Checkout @@ -16,7 +19,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: '3.11' + python-version: ${{ matrix.python-version }} - name: Install Poetry run: | python -m pip install --upgrade pip From dd7db7451c6509444513ab7629b6cd6a99cab2d8 Mon Sep 17 00:00:00 2001 From: Lloyd Dakin Date: Fri, 6 Sep 2024 11:53:39 -0700 Subject: [PATCH 3/4] change tests push to only main branch --- .github/workflows/django-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/django-test.yml b/.github/workflows/django-test.yml index d0b5804..215d7a4 100644 --- a/.github/workflows/django-test.yml +++ b/.github/workflows/django-test.yml @@ -2,6 +2,7 @@ name: Django Test on: push: + branches: [ "main" ] pull_request: branches: [ "main" ] From b04edbb2d9e53765a9433d1b381a02b3c09d8093 Mon Sep 17 00:00:00 2001 From: Lloyd Dakin Date: Fri, 6 Sep 2024 11:56:44 -0700 Subject: [PATCH 4/4] change name of action --- .github/workflows/django-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/django-test.yml b/.github/workflows/django-test.yml index 215d7a4..b9244a9 100644 --- a/.github/workflows/django-test.yml +++ b/.github/workflows/django-test.yml @@ -1,4 +1,4 @@ -name: Django Test +name: Test Datalab on: push: @@ -7,7 +7,7 @@ on: branches: [ "main" ] jobs: - build: + test: runs-on: ubuntu-latest strategy: