From 0c2deaeb825127fb199aac19a9a7bb161e1d5ed5 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Thu, 20 Mar 2025 10:02:01 +0100 Subject: [PATCH 1/3] Add acc test for case where both 'build' and 'files' are specified --- .../artifacts/build_and_files_whl/databricks.yml | 10 ++++++++++ .../artifacts/build_and_files_whl/output.txt | 16 ++++++++++++++++ .../bundle/artifacts/build_and_files_whl/script | 5 +++++ .../artifacts/build_and_files_whl/test.toml | 2 ++ 4 files changed, 33 insertions(+) create mode 100644 acceptance/bundle/artifacts/build_and_files_whl/databricks.yml create mode 100644 acceptance/bundle/artifacts/build_and_files_whl/output.txt create mode 100644 acceptance/bundle/artifacts/build_and_files_whl/script create mode 100644 acceptance/bundle/artifacts/build_and_files_whl/test.toml diff --git a/acceptance/bundle/artifacts/build_and_files_whl/databricks.yml b/acceptance/bundle/artifacts/build_and_files_whl/databricks.yml new file mode 100644 index 0000000000..2ced1cdbad --- /dev/null +++ b/acceptance/bundle/artifacts/build_and_files_whl/databricks.yml @@ -0,0 +1,10 @@ +bundle: + name: build_and_files_whl + +artifacts: + artifact_with_custom_dist: + # commenting out 'type: whl' here actually makes 'bundle deploy' to work + type: whl + build: python setup.py bdist_wheel --dist-dir mydist + files: + - source: mydist/*.whl diff --git a/acceptance/bundle/artifacts/build_and_files_whl/output.txt b/acceptance/bundle/artifacts/build_and_files_whl/output.txt new file mode 100644 index 0000000000..cdfb33c13f --- /dev/null +++ b/acceptance/bundle/artifacts/build_and_files_whl/output.txt @@ -0,0 +1,16 @@ + +>>> [CLI] bundle validate +Name: build_and_files_whl +Target: default +Workspace: + User: [USERNAME] + Path: /Workspace/Users/[USERNAME]/.bundle/build_and_files_whl/default + +Validation OK! + +>>> errcode [CLI] bundle deploy +Building artifact_with_custom_dist... +Error: cannot find built wheel in [TMPDIR] for package artifact_with_custom_dist + + +Exit code: 1 diff --git a/acceptance/bundle/artifacts/build_and_files_whl/script b/acceptance/bundle/artifacts/build_and_files_whl/script new file mode 100644 index 0000000000..41a5d7eae3 --- /dev/null +++ b/acceptance/bundle/artifacts/build_and_files_whl/script @@ -0,0 +1,5 @@ +cp -r $TESTDIR/../whl_explicit/my_test_code/* . +trace $CLI bundle validate +# I expect this deploy to work because I explicitly told where to find the wheel, but it does not: +trace errcode $CLI bundle deploy +rm mydist/my_test_code-0.0.1-py3-none-any.whl setup.py src/*.py diff --git a/acceptance/bundle/artifacts/build_and_files_whl/test.toml b/acceptance/bundle/artifacts/build_and_files_whl/test.toml new file mode 100644 index 0000000000..a05cfa9087 --- /dev/null +++ b/acceptance/bundle/artifacts/build_and_files_whl/test.toml @@ -0,0 +1,2 @@ +Badness = "artifacts of type 'whl' hard-code dist directory even if explicit files section is present" +RecordRequests = false From 147c36bd205f748c993ee9a345e073cfe362341d Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Thu, 20 Mar 2025 10:07:23 +0100 Subject: [PATCH 2/3] update comment --- acceptance/bundle/artifacts/build_and_files_whl/databricks.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/acceptance/bundle/artifacts/build_and_files_whl/databricks.yml b/acceptance/bundle/artifacts/build_and_files_whl/databricks.yml index 2ced1cdbad..8afd2e2313 100644 --- a/acceptance/bundle/artifacts/build_and_files_whl/databricks.yml +++ b/acceptance/bundle/artifacts/build_and_files_whl/databricks.yml @@ -3,7 +3,8 @@ bundle: artifacts: artifact_with_custom_dist: - # commenting out 'type: whl' here actually makes 'bundle deploy' to work + # commenting out 'type: whl' here actually makes 'bundle deploy' to build and upload correct wheel, + # because for non-whl types it does respect 'files' section. type: whl build: python setup.py bdist_wheel --dist-dir mydist files: From 0d135d838e6056aa0f1bac2e63f3f752534a6729 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Thu, 20 Mar 2025 10:31:33 +0100 Subject: [PATCH 3/3] Replace '*' with '{setup.py,src}' to fix Windows --- acceptance/bundle/artifacts/build_and_files_whl/script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acceptance/bundle/artifacts/build_and_files_whl/script b/acceptance/bundle/artifacts/build_and_files_whl/script index 41a5d7eae3..2d7d63f7fe 100644 --- a/acceptance/bundle/artifacts/build_and_files_whl/script +++ b/acceptance/bundle/artifacts/build_and_files_whl/script @@ -1,4 +1,4 @@ -cp -r $TESTDIR/../whl_explicit/my_test_code/* . +cp -r $TESTDIR/../whl_explicit/my_test_code/{setup.py,src} . trace $CLI bundle validate # I expect this deploy to work because I explicitly told where to find the wheel, but it does not: trace errcode $CLI bundle deploy