Skip to content

Commit 68fd556

Browse files
Add ipykernel to default template and fix conftest comment
## Changes - Added ipykernel to dev dependencies in default template's pyproject.toml - Fixed outdated comment in conftest.py (removed reference to 'tests under resources/') - Updated acceptance test outputs for default-python, lakeflow-pipelines, and pydabs templates ## Why ipykernel enables Jupyter notebook support with the project's virtual environment, which is essential for the exploratory notebooks included in the template. The conftest comment was outdated and misleading. ## Investigation Confirmed that databricks.sdk.runtime.spark already works correctly in the template: - Unit tests properly use databricks.sdk.runtime.spark - pytest --collect-only is fast (~0.05s) and doesn't eagerly connect - DBR 15+ compatibility works via validateSession() - The eager initialization in conftest.py serves real purposes (compute config, version validation) and should be kept ## Tests - All template acceptance tests pass - Verified pytest --collect-only behavior - Tested on Python 3.9-3.13 - Tested with both classic and serverless compute
1 parent daef3df commit 68fd556

File tree

8 files changed

+8
-6
lines changed

8 files changed

+8
-6
lines changed

acceptance/bundle/templates/default-python/classic/output/my_default_python/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dev = [
1616
"pytest",
1717
"databricks-dlt",
1818
"databricks-connect>=15.4,<15.5",
19+
"ipykernel",
1920
]
2021

2122
[project.scripts]

acceptance/bundle/templates/default-python/classic/output/my_default_python/tests/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""This file configures pytest.
22
3-
This file is in the root since it can be used for tests in any place in this
4-
project, including tests under resources/.
3+
This file can be used for tests in any place in this project.
54
"""
65

76
import os, sys, pathlib

acceptance/bundle/templates/default-python/serverless/output/my_default_python/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dev = [
1616
"pytest",
1717
"databricks-dlt",
1818
"databricks-connect>=15.4,<15.5",
19+
"ipykernel",
1920
]
2021

2122
[project.scripts]

acceptance/bundle/templates/default-python/serverless/output/my_default_python/tests/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""This file configures pytest.
22
3-
This file is in the root since it can be used for tests in any place in this
4-
project, including tests under resources/.
3+
This file can be used for tests in any place in this project.
54
"""
65

76
import os, sys, pathlib

acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dev = [
1616
"pytest",
1717
"databricks-dlt",
1818
"databricks-connect>=15.4,<15.5",
19+
"ipykernel",
1920
]
2021

2122
[project.scripts]

acceptance/bundle/templates/pydabs/init-classic/output/my_pydabs/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dev = [
1616
"pytest",
1717
"databricks-dlt",
1818
"databricks-connect>=15.4,<15.5",
19+
"ipykernel",
1920
"databricks-bundles==x.y.z",
2021
]
2122

libs/template/templates/default/template/{{.project_name}}/pyproject.toml.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dev = [
1616
"pytest",
1717
"databricks-dlt",
1818
"databricks-connect{{template "conservative_db_connect_version_spec"}}",
19+
"ipykernel",
1920
{{- if eq .enable_pydabs "yes" }}
2021
"databricks-bundles=={{template "latest_databricks_bundles_version"}}",
2122
{{- end }}

libs/template/templates/default/template/{{.project_name}}/tests/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""This file configures pytest.
22
3-
This file is in the root since it can be used for tests in any place in this
4-
project, including tests under resources/.
3+
This file can be used for tests in any place in this project.
54
"""
65

76
import os, sys, pathlib

0 commit comments

Comments
 (0)