Skip to content

Commit f41821e

Browse files
committed
utils: support project-local kernels
1 parent 5819213 commit f41821e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/penguin/utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,15 @@ def get_kernel(conf: dict, proj_dir: str) -> str:
435435
"""
436436
kernel = conf["core"].get("kernel", None)
437437
if kernel:
438+
# Check if the kernel exists as an absolute path or relative to current execution dir
438439
if os.path.exists(kernel) and os.path.isfile(kernel):
439440
return kernel
441+
442+
# Check if the kernel exists relative to the project directory
443+
proj_kernel = os.path.join(proj_dir, kernel)
444+
if os.path.exists(proj_kernel) and os.path.isfile(proj_kernel):
445+
return proj_kernel
446+
440447
from penguin.q_config import load_q_config
441448
from glob import glob
442449
q_config = load_q_config(conf)

0 commit comments

Comments
 (0)