-
Notifications
You must be signed in to change notification settings - Fork 152
When globbing for wheels, only consider most recent version; do not clean up dist/build/__pycache__ #2982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
When globbing for wheels, only consider most recent version; do not clean up dist/build/__pycache__ #2982
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
87cae7f
when collecting libraries, convert them to absolute path
denik d6b012a
only join is not abs already
denik 138190a
add filter + version
denik 6f48b6b
enable filtering; disable pythin clean ups add acc test; ignore previ…
denik e35e713
no Background
denik e7f1f41
clean up
denik 21370e4
update test
denik 980a066
clean up and extend tests
denik 2e4445e
fix
denik 8b24696
clean up & rebase
denik a7f36bf
rewrite test
denik 2cc0910
stricter defaultExcludes
denik fd214ff
remove default sync excludes
denik 670bd5d
revert convertion to abs in upload.go
denik b7518f6
update NEXT_CHANGELOG
denik c0d9c66
formatting
denik 4f46907
fix formatting
denik 00b560a
clean up newline
denik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| build/ | ||
| *.egg-info | ||
| .databricks |
12 changes: 12 additions & 0 deletions
12
acceptance/bundle/artifacts/whl_change_version/databricks.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| resources: | ||
| jobs: | ||
| test_job: | ||
| name: "[${bundle.target}] My Wheel Job" | ||
| tasks: | ||
| - task_key: TestTask | ||
| existing_cluster_id: "0717-aaaaa-bbbbbb" | ||
| python_wheel_task: | ||
| package_name: "my_test_code" | ||
| entry_point: "run" | ||
| libraries: | ||
| - whl: ./dist/*.whl |
2 changes: 2 additions & 0 deletions
2
acceptance/bundle/artifacts/whl_change_version/my_test_code/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| __version__ = "0.1.0" | ||
| __author__ = "Databricks" |
16 changes: 16 additions & 0 deletions
16
acceptance/bundle/artifacts/whl_change_version/my_test_code/__main__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| """ | ||
| The entry point of the Python Wheel | ||
| """ | ||
|
|
||
| import sys | ||
|
|
||
|
|
||
| def main(): | ||
| # This method will print the provided arguments | ||
| print("Hello from my func") | ||
| print("Got arguments:") | ||
| print(sys.argv) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
138 changes: 138 additions & 0 deletions
138
acceptance/bundle/artifacts/whl_change_version/output.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Building python_artifact... | ||
| Uploading dist/my_test_code-0.1.0-py3-none-any.whl... | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| >>> find.py --expect 1 whl | ||
| dist/my_test_code-0.1.0-py3-none-any.whl | ||
|
|
||
| === Expecting 1 wheel in libraries section in /jobs/create | ||
| >>> jq -s .[] | select(.path=="/api/2.2/jobs/create") | .body.tasks out.requests.txt | ||
| [ | ||
| { | ||
| "existing_cluster_id": "0717-aaaaa-bbbbbb", | ||
| "libraries": [ | ||
| { | ||
| "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.1.0-py3-none-any.whl" | ||
| } | ||
| ], | ||
| "python_wheel_task": { | ||
| "entry_point": "run", | ||
| "package_name": "my_test_code" | ||
| }, | ||
| "task_key": "TestTask" | ||
| } | ||
| ] | ||
|
|
||
| === Expecting 1 wheel to be uploaded | ||
| >>> jq .path out.requests.txt | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.1.0-py3-none-any.whl" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/.gitignore" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/databricks.yml" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/dist/my_test_code-0.1.0-py3-none-any.whl" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/my_test_code/__init__.py" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/my_test_code/__main__.py" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/out.requests.txt" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/output.txt" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/repls.json" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/script" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/setup.py" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/deploy.lock" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/deployment.json" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/metadata.json" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/terraform.tfstate" | ||
|
|
||
| >>> update_file.py my_test_code/__init__.py 0.1.0 0.2.0 | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Building python_artifact... | ||
| Uploading dist/my_test_code-0.2.0-py3-none-any.whl... | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| >>> find.py --expect 2 whl | ||
| dist/my_test_code-0.1.0-py3-none-any.whl | ||
| dist/my_test_code-0.2.0-py3-none-any.whl | ||
|
|
||
| === Expecting 1 wheel in libraries section in /jobs/reset | ||
| >>> jq -s .[] | select(.path=="/api/2.2/jobs/reset") | .body.new_settings.tasks out.requests.txt | ||
| [ | ||
| { | ||
| "existing_cluster_id": "0717-aaaaa-bbbbbb", | ||
| "libraries": [ | ||
| { | ||
| "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.2.0-py3-none-any.whl" | ||
| } | ||
| ], | ||
| "python_wheel_task": { | ||
| "entry_point": "run", | ||
| "package_name": "my_test_code" | ||
| }, | ||
| "task_key": "TestTask" | ||
| } | ||
| ] | ||
|
|
||
| === Expecting 1 wheel to be uploaded | ||
| >>> jq .path out.requests.txt | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.2.0-py3-none-any.whl" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/dist/my_test_code-0.2.0-py3-none-any.whl" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/my_test_code/__init__.py" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/out.requests.txt" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/output.txt" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/deploy.lock" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/deployment.json" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/metadata.json" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/terraform.tfstate" | ||
|
|
||
| === Restore config to target old wheel | ||
| >>> update_file.py databricks.yml ./dist/*.whl ./dist/my*0.1.0*.whl | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Building python_artifact... | ||
| Uploading dist/my_test_code-0.1.0-py3-none-any.whl... | ||
| Uploading dist/my_test_code-0.2.0-py3-none-any.whl... | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| >>> find.py --expect 2 whl | ||
| dist/my_test_code-0.1.0-py3-none-any.whl | ||
| dist/my_test_code-0.2.0-py3-none-any.whl | ||
|
|
||
| === Expecting 1 wheel in libraries section in /jobs/reset | ||
| >>> jq -s .[] | select(.path=="/api/2.2/jobs/reset") | .body.new_settings.tasks out.requests.txt | ||
| [ | ||
| { | ||
| "existing_cluster_id": "0717-aaaaa-bbbbbb", | ||
| "libraries": [ | ||
| { | ||
| "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.1.0-py3-none-any.whl" | ||
| } | ||
| ], | ||
| "python_wheel_task": { | ||
| "entry_point": "run", | ||
| "package_name": "my_test_code" | ||
| }, | ||
| "task_key": "TestTask" | ||
| } | ||
| ] | ||
|
|
||
| === Expecting 1 wheel to be uploaded | ||
| >>> jq .path out.requests.txt | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.1.0-py3-none-any.whl" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.2.0-py3-none-any.whl" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does it upload both?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/databricks.yml" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/dist/my_test_code-0.2.0-py3-none-any.whl" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/out.requests.txt" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/output.txt" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/deploy.lock" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/deployment.json" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/metadata.json" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/terraform.tfstate" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| trace $CLI bundle deploy | ||
|
|
||
| trace find.py --expect 1 whl | ||
|
|
||
| title "Expecting 1 wheel in libraries section in /jobs/create" | ||
| trace jq -s '.[] | select(.path=="/api/2.2/jobs/create") | .body.tasks' out.requests.txt | ||
|
|
||
| title "Expecting 1 wheel to be uploaded" | ||
| trace jq .path out.requests.txt | grep import | sort | ||
|
|
||
| rm out.requests.txt | ||
|
|
||
|
|
||
| trace update_file.py my_test_code/__init__.py 0.1.0 0.2.0 | ||
| trace $CLI bundle deploy | ||
|
|
||
| trace find.py --expect 2 whl # there are now 2 wheels on disk | ||
|
|
||
| title "Expecting 1 wheel in libraries section in /jobs/reset" | ||
| trace jq -s '.[] | select(.path=="/api/2.2/jobs/reset") | .body.new_settings.tasks' out.requests.txt | ||
|
|
||
| title "Expecting 1 wheel to be uploaded" | ||
| trace jq .path out.requests.txt | grep import | sort | ||
|
|
||
| rm out.requests.txt | ||
|
|
||
|
|
||
| title 'Restore config to target old wheel' | ||
| trace update_file.py databricks.yml './dist/*.whl' './dist/my*0.1.0*.whl' | ||
| trace $CLI bundle deploy | ||
| trace find.py --expect 2 whl | ||
|
|
||
| title "Expecting 1 wheel in libraries section in /jobs/reset" | ||
| trace jq -s '.[] | select(.path=="/api/2.2/jobs/reset") | .body.new_settings.tasks' out.requests.txt | ||
|
|
||
| title "Expecting 1 wheel to be uploaded" | ||
| trace jq .path out.requests.txt | grep import | sort | ||
|
|
||
| rm out.requests.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| from setuptools import setup, find_packages | ||
|
|
||
| import my_test_code | ||
|
|
||
| setup( | ||
| name="my_test_code", | ||
| version=my_test_code.__version__, | ||
| author=my_test_code.__author__, | ||
| url="https://databricks.com", | ||
| author_email="[email protected]", | ||
| description="my test wheel", | ||
| packages=find_packages(include=["my_test_code"]), | ||
| entry_points={"group_1": "run=my_test_code.__main__:main"}, | ||
| install_requires=["setuptools"], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are both uploaded if the glob only matches the
0.1.0one?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The glob in libraries matches 0.1.0 but the glob in artifacts section matches 0.2.0.
Those filters operate independently from different mutators so each makes their own decision.
Perhaps it's a sign that glob expansion should be done from a single place with a global tracker of wheel versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the glob in artifacts implicit or a default? If so, that seems surprising.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean? implicit == default, no?
Somewhat. It would also be surprising if default
*.whlbehaved differently from explicit*.whl