Skip to content

Commit 29f5ef2

Browse files
authored
acc: Set UV_PYTHON env variable (#2562)
## Changes Set UV_PYTHON env. variable to test against a single Python version. Don't expand `EnvMatrix` into sub-tests if there is only a single entry to avoid additional noise. Add logging so we can debug which env. variables are used. ## Tests Using existing acceptance tests
1 parent 314766a commit 29f5ef2

File tree

11 files changed

+20
-9
lines changed

11 files changed

+20
-9
lines changed

acceptance/acceptance_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,10 @@ func testAccept(t *testing.T, InprocessMode bool, singleTest string) int {
218218

219219
expanded := internal.ExpandEnvMatrix(config.EnvMatrix)
220220

221-
if len(expanded) == 1 && len(expanded[0]) == 0 {
221+
if len(expanded) == 1 {
222+
// env vars aren't part of the test case name, so log them for debugging
223+
t.Logf("Running test with env %v", expanded[0])
224+
222225
runTest(t, dir, coverDir, repls.Clone(), config, configPath, expanded[0])
223226
} else {
224227
for _, envset := range expanded {

acceptance/bundle/artifacts/script.prepare

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export PYTHONDONTWRITEBYTECODE=1
22

3-
uv venv -q --python 3.12 .venv
3+
uv venv -q .venv
44
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || "$OSTYPE" == "win32" ]]; then
55
source .venv/Scripts/activate
66
else

acceptance/bundle/python/mutator-ordering/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
>>> uv run --python 3.10 [UV_ARGS] -q [CLI] bundle validate --output json
2+
>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json
33
{
44
"experimental": {
55
"python": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
UV_ARGS="${UV_ARGS//\[\DATABRICKS_BUNDLES_WHEEL\]/$DATABRICKS_BUNDLES_WHEEL}"
22

3-
trace uv run --python 3.10 $UV_ARGS -q $CLI bundle validate --output json | \
3+
trace uv run $UV_ARGS -q $CLI bundle validate --output json | \
44
jq "pick(.experimental.python, .resources)"
55

66
rm -fr .databricks __pycache__

acceptance/bundle/python/resolve-variable/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
>>> uv run --python 3.10 [UV_ARGS] -q [CLI] bundle validate --output json
2+
>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json
33
{
44
"experimental": {
55
"python": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
UV_ARGS="${UV_ARGS//\[\DATABRICKS_BUNDLES_WHEEL\]/$DATABRICKS_BUNDLES_WHEEL}"
22

3-
trace uv run --python 3.10 $UV_ARGS -q $CLI bundle validate --output json | \
3+
trace uv run $UV_ARGS -q $CLI bundle validate --output json | \
44
jq "pick(.experimental.python, .resources)"
55

66
rm -fr .databricks __pycache__

acceptance/bundle/python/resource-loading/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
>>> uv run --python 3.10 [UV_ARGS] -q [CLI] bundle validate --output json
2+
>>> uv run [UV_ARGS] -q [CLI] bundle validate --output json
33
{
44
"experimental": {
55
"python": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
UV_ARGS="${UV_ARGS//\[\DATABRICKS_BUNDLES_WHEEL\]/$DATABRICKS_BUNDLES_WHEEL}"
22

3-
trace uv run --python 3.10 $UV_ARGS -q $CLI bundle validate --output json | \
3+
trace uv run $UV_ARGS -q $CLI bundle validate --output json | \
44
jq "pick(.experimental.python, .resources)"
55

66
rm -fr .databricks __pycache__

acceptance/bundle/templates/experimental-jobs-as-code/output/my_jobs_as_code/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "my_jobs_as_code"
7-
requires-python = ">=3.10"
87
description = "wheel file based on my_jobs_as_code"
98

109
# Dependencies in case the output wheel file is used as a library dependency.

acceptance/bundle/templates/experimental-jobs-as-code/script

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ trace unzip -Z1 dist/my_jobs_as_code-0.0.1-py3-none-any.whl
1212

1313
rm -fr .venv resources/__pycache__ uv.lock src/my_jobs_as_code.egg-info dist
1414

15+
# remove requires-python because it doesn't pass ruff checks after we replace
16+
# requires-python=">=3.10" with requires-python=">=[UV_PYTHON]"
17+
cat pyproject.toml | grep -v requires-python > pyproject.toml.new
18+
mv pyproject.toml.new pyproject.toml
19+
1520
# Do not affect this repository's git behaviour #2318
1621
mv .gitignore out.gitignore
1722
rm .databricks/.gitignore

0 commit comments

Comments
 (0)