Skip to content

Commit

Permalink
Updated nb-connector for pinned slc_release (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomuben authored Sep 6, 2024
1 parent 776bb08 commit 37fc7e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ scikit-learn==1.5.1 # required for notebook sklearn
matplotlib==3.7.4 # required for notebook sklearn
jupysql==0.10.10 # required for multiple notebooks
stopwatch.py>=2.0.1 # also required by ITDE
exasol-notebook-connector @ git+https://github.com/exasol/notebook-connector@e3a8525
exasol-notebook-connector @ git+https://github.com/exasol/notebook-connector@63a755a
pickleshare==0.7.5 # See https://github.com/exasol/ai-lab/issues/291 for details.
ipyfilechooser==0.6.0 # required for SLC notebooks
ipywidgets==8.1.1 # enable interactive Javascript widgets in the notebooks
15 changes: 6 additions & 9 deletions test/notebooks/nbtest_script_languages_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from notebook_test_utils import (backend_setup,
run_notebook)
from exasol.nb_connector.ai_lab_config import AILabConfig as CKey
from exasol.nb_connector.slct_manager import SlctManager
from exasol.nb_connector.secret_store import Secrets
from exasol.pytest_backend import BACKEND_ONPREM

Expand All @@ -17,13 +18,14 @@ def _slc_repo_dir() -> Path:
return Path.cwd() / "script_languages_release"


def _store_slc_config(store_path: Path, store_password: str, clone_repo: bool):
def _store_slc_config(store_path: Path, store_password: str, clone_repo: bool) -> Secrets:

slc_source = "Clone script languages release repository" if clone_repo else "Use the existing clone"
conf = Secrets(store_path, store_password)
conf.connection()
conf.save(CKey.slc_source, slc_source)
conf.save(CKey.slc_target_dir, str(_slc_repo_dir()))
return conf


@pytest.fixture()
Expand Down Expand Up @@ -56,12 +58,6 @@ def test_script_languages_container_cloning_slc_repo(backend,
os.chdir(current_dir)


def _clone_slc_repo():
from git import Repo
repo = Repo.clone_from("https://github.com/exasol/script-languages-release", _slc_repo_dir())
repo.submodule_update(recursive=True)


def test_script_languages_container_with_existing_slc_repo(backend,
backend_setup,
cleanup_slc_repo_dir) -> None:
Expand All @@ -75,8 +71,9 @@ def test_script_languages_container_with_existing_slc_repo(backend,
os.chdir('./script_languages_container')
slc_repo_path = _slc_repo_dir()
assert not slc_repo_path.is_dir()
_clone_slc_repo()
_store_slc_config(store_path, store_password, False)
secrets = _store_slc_config(store_path, store_password, False)
slct_manager = SlctManager(secrets)
slct_manager.clone_slc_repo()
run_notebook('configure_slc_repository.ipynb', store_file, store_password)
run_notebook('export_as_is.ipynb', store_file, store_password)
run_notebook('customize.ipynb', store_file, store_password)
Expand Down

0 comments on commit 37fc7e2

Please sign in to comment.