Skip to content

Commit

Permalink
chore: sync project template
Browse files Browse the repository at this point in the history
  • Loading branch information
makkus committed Apr 15, 2024
1 parent 27d54d0 commit c697624
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/DHARPA-Project/kiara_plugin.develop.git",
"commit": "96e37df1692a56068082857a41318dc7d17f1643",
"commit": "61841496d46e8ce4f79da1126443524bde03f977",
"context": {
"cookiecutter": {
"full_name": "Markus Binsteiner",
Expand Down
2 changes: 1 addition & 1 deletion ci/conda/conda-pkg-patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ test:
- examples
commands:
- kiara module list
- kiara run import.table.from.local_file_path path=examples/data/journals/JournalEdges1902.csv
- kiara run import.table.from.local_file_path path=examples/data/journals/JournalEdges1902.csv -c conda
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ classifiers = [
"Programming Language :: Python :: 3.12"
]
dependencies = [
"kiara>=0.5.10rc6,<0.6.0",
"kiara_plugin.core_types>=0.5.0,<0.6.0",
"kiara>=0.5.10rc10,<0.6.0",
"kiara_plugin.core_types>=0.5.1rc1,<0.6.0",
"duckdb>=0.10.0,<0.11.0",
"pandas>=1.4.0",
"polars>=0.18.0",
Expand Down
31 changes: 20 additions & 11 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@

import pytest

from kiara.api import JobDesc, KiaraAPI
from kiara.context import KiaraConfig
from kiara.interfaces.python_api import KiaraAPI
from kiara.interfaces.python_api.models.job import JobDesc, JobTest
from kiara.interfaces.python_api.models.job import JobTest
from kiara.utils.testing import get_init_job, get_tests_for_job, list_job_descs

ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
JOBS_FOLDER = Path(os.path.join(ROOT_DIR, "examples", "jobs"))
JOBS_FOLDERS = [
Path(os.path.join(ROOT_DIR, "tests", "resources", "jobs")),
Path(os.path.join(ROOT_DIR, "examples", "jobs")),
]


def create_temp_dir():
Expand Down Expand Up @@ -54,22 +57,28 @@ def kiara_api_init_example() -> KiaraAPI:
kc = KiaraConfig.create_in_folder(instance_path)
api = KiaraAPI(kc)

init_job = get_init_job(JOBS_FOLDER)
if init_job is None:
init_jobs = []
for jobs_folder in JOBS_FOLDERS:
init_job = get_init_job(jobs_folder)
if init_job is not None:
init_jobs.append(init_job)

if not init_jobs:
return api

results = api.run_job(init_job, comment="Init test job")
for init_job in init_jobs:
results = api.run_job(init_job, comment="Init example job")

if not init_job.save:
return api
if not init_job.save:
continue

for field_name, alias_name in init_job.save.items():
api.store_value(results[field_name], alias_name)
for field_name, alias_name in init_job.save.items():
api.store_value(results[field_name], alias_name)

return api


@pytest.fixture(params=list_job_descs(JOBS_FOLDER), ids=get_job_alias)
@pytest.fixture(params=list_job_descs(JOBS_FOLDERS), ids=get_job_alias)
def example_job_test(request, kiara_api_init_example) -> JobTest:

job_tests_folder = Path(os.path.join(ROOT_DIR, "tests", "job_tests"))
Expand Down
Empty file added tests/resources/jobs/.gitkeep
Empty file.
Empty file.

0 comments on commit c697624

Please sign in to comment.