Skip to content

Commit 93f76dd

Browse files
ci(kernel-e2e): build kernel wheel into connector venv, not a new one
`poetry run maturin develop` from inside databricks-sql-kernel/pyo3/ makes poetry create a fresh, empty .venv next to the kernel source (it discovers pyo3/pyproject.toml first and treats it as the project root). That venv has no maturin → "Command not found: maturin". Resolve the connector venv's python path explicitly before changing working directory, then call maturin from that python via `-m maturin`. `--interpreter <path>` pins the produced wheel to the connector venv so the resulting extension is installed where pytest will look for it. Co-authored-by: Isaac Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
1 parent f7ed5e3 commit 93f76dd

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

.github/workflows/kernel-e2e.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,16 +273,29 @@ jobs:
273273
install-args: "--all-extras"
274274
cache-suffix: "kernel-e2e-"
275275

276-
- name: Install maturin into the poetry venv
277-
run: poetry run pip install 'maturin>=1.5,<2.0'
276+
- name: Install maturin into the connector venv
277+
# The connector's poetry venv is in-project (.venv at repo
278+
# root). The kernel's pyo3/ subtree carries its own
279+
# pyproject.toml — running `poetry run …` from inside it
280+
# makes poetry create a *second* venv next to the kernel
281+
# source, which won't have maturin or the connector
282+
# installed. We side-step that by resolving the connector
283+
# venv's python here and calling maturin via its absolute
284+
# path for the build step.
285+
run: |
286+
poetry run pip install 'maturin>=1.5,<2.0'
287+
VENV_PY=$(poetry run python -c "import sys; print(sys.executable)")
288+
echo "CONNECTOR_VENV_PY=$VENV_PY" >> "$GITHUB_ENV"
289+
echo "Using connector venv python: $VENV_PY"
278290
279-
- name: Build + install kernel wheel into poetry venv
291+
- name: Build + install kernel wheel into connector venv
280292
working-directory: databricks-sql-kernel/pyo3
281-
# `maturin develop` builds the extension and installs it into
282-
# whichever Python is on PATH. `poetry run` resolves to the
283-
# connector's .venv, so the wheel lands where pytest will
284-
# import it.
285-
run: poetry run maturin develop --release
293+
# `--interpreter $CONNECTOR_VENV_PY` pins maturin to the
294+
# connector venv even though we're cwd'd inside the kernel's
295+
# own pyproject tree. `python -m maturin` invokes the
296+
# maturin we just installed into that same venv, sidestepping
297+
# the nested-poetry-project detection entirely.
298+
run: $CONNECTOR_VENV_PY -m maturin develop --release --interpreter $CONNECTOR_VENV_PY
286299

287300
- name: Smoke-check kernel import
288301
run: |

0 commit comments

Comments
 (0)