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

find_module deprecated in 3.12 replacing with import_module #28

Merged
merged 4 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/django-test.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
name: Django Test
name: Test Datalab

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
test:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- name: Checkout
uses: actions/checkout@v4
- 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
Expand Down
3 changes: 2 additions & 1 deletion datalab/datalab_session/data_operations/utils.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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):
Expand Down
Loading