-
Notifications
You must be signed in to change notification settings - Fork 222
Add orthogonal setup-local flags: --no-constraints and --no-dbconnect
#6464
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
Open
rugpanov
wants to merge
1
commit into
main
Choose a base branch
from
setup-local/orthogonal-flags
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Added orthogonal `--no-constraints` and `--no-dbconnect` flags to `databricks environments setup-local`. The flags compose: `--no-constraints` skips writing the remote Python-version and dependency pins, and `--no-dbconnect` skips the databricks-connect dependency. |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
|
|
||
| >>> [CLI] environments setup-local --serverless-version 4 --no-constraints --dry-run --output json | ||
| { | ||
| "schemaVersion": 1, | ||
| "command": "environments setup-local", | ||
| "ok": true, | ||
| "mode": "default", | ||
| "dryRun": true, | ||
| "compute": { | ||
| "source": "serverless", | ||
| "serverlessVersion": "v4", | ||
| "envKey": "serverless/serverless-v4" | ||
| }, | ||
| "resolved": { | ||
| "pythonVersion": "3.12", | ||
| "dbconnectVersion": "17.2.0", | ||
| "artifactSource": "network" | ||
| }, | ||
| "greenfield": false, | ||
| "plan": { | ||
| "wouldWrite": "[TEST_TMP_DIR]/pyproject.toml", | ||
| "wouldBackup": "[TEST_TMP_DIR]/pyproject.toml.bak", | ||
| "wouldInstallPython": "3.12", | ||
| "diff": "--- pyproject.toml\n+++ pyproject.toml.new\n@@ -3,4 +3,7 @@\n requires-python = \"\u003e=3.10\"\n \n [dependency-groups]\n-dev = [\"databricks-connect~=16.0\"]\n+dev = [\"databricks-connect~=17.2.0\"]\n+\n+[tool.databricks.environment]\n+environment_version = \"4\"\n" | ||
| }, | ||
| "phases": [ | ||
| { | ||
| "phase": "preflight", | ||
| "status": "ok" | ||
| }, | ||
| { | ||
| "phase": "resolve", | ||
| "status": "ok" | ||
| }, | ||
| { | ||
| "phase": "fetch", | ||
| "status": "ok" | ||
| }, | ||
| { | ||
| "phase": "merge", | ||
| "status": "ok" | ||
| }, | ||
| { | ||
| "phase": "provision", | ||
| "status": "ok" | ||
| }, | ||
| { | ||
| "phase": "validate", | ||
| "status": "ok" | ||
| } | ||
| ], | ||
| "warnings": [ | ||
| { | ||
| "code": "W_DBCONNECT_PIN_OVERRIDDEN", | ||
| "message": "databricks-connect \"databricks-connect~=16.0\" is replaced by the environment's \"databricks-connect~=17.2.0\"" | ||
| } | ||
| ], | ||
| "error": null, | ||
| "durationMs": [DURATION_MS] | ||
| } |
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 @@ | ||
| # --no-constraints leaves the remote Python version and dependency pins | ||
| # unmanaged: the plan writes neither requires-python nor the [tool.uv] constraint | ||
| # block, and the user's existing requires-python is left untouched. The | ||
| # databricks-connect dependency (orthogonal to --no-constraints) is still managed. | ||
| # The JSON plan shows the diff. | ||
| cat > pyproject.toml <<'PY' | ||
| [project] | ||
| name = "demo" | ||
| requires-python = ">=3.10" | ||
|
|
||
| [dependency-groups] | ||
| dev = ["databricks-connect~=16.0"] | ||
| PY | ||
|
|
||
| trace $CLI environments setup-local --serverless-version 4 --no-constraints --dry-run --output json |
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,23 @@ | ||
| EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] | ||
|
|
||
| # The script writes pyproject.toml as the merge input; --dry-run leaves it unchanged. | ||
| Ignore = ["pyproject.toml"] | ||
|
|
||
| Env.DATABRICKS_LOCALENV_CONSTRAINT_SOURCE_URL_TEST_OVERRIDE = "$DATABRICKS_HOST" | ||
|
|
||
| [[Server]] | ||
| Pattern = "GET /serverless/serverless-v4/pyproject.toml" | ||
| Response.Body = ''' | ||
| [project] | ||
| requires-python = ">=3.12" | ||
|
|
||
| [dependency-groups] | ||
| dev = ["databricks-connect~=17.2.0"] | ||
|
|
||
| [tool.uv] | ||
| constraint-dependencies = ["pyarrow<19"] | ||
| ''' | ||
|
|
||
| [[Repls]] | ||
| Old = 'uv uv \S+(?: \([^)]+\))?' | ||
| New = 'uv [UV_VERSION]' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
|
|
||
| >>> [CLI] environments setup-local --serverless-version 4 --no-dbconnect --dry-run --output json | ||
| { | ||
| "schemaVersion": 1, | ||
| "command": "environments setup-local", | ||
| "ok": true, | ||
| "mode": "constraints-only", | ||
| "dryRun": true, | ||
| "compute": { | ||
| "source": "serverless", | ||
| "serverlessVersion": "v4", | ||
| "envKey": "serverless/serverless-v4" | ||
| }, | ||
| "resolved": { | ||
| "pythonVersion": "3.12", | ||
| "artifactSource": "network" | ||
| }, | ||
| "greenfield": false, | ||
| "plan": { | ||
| "wouldWrite": "[TEST_TMP_DIR]/pyproject.toml", | ||
| "wouldBackup": "[TEST_TMP_DIR]/pyproject.toml.bak", | ||
| "wouldInstallPython": "3.12", | ||
| "diff": "--- pyproject.toml\n+++ pyproject.toml.new\n@@ -1,7 +1,17 @@\n [project]\n name = \"demo\"\n-requires-python = \"\u003e=3.10\"\n+requires-python = \"\u003e=3.12\"\n dependencies = [\"databricks-connect==15.1.*\"]\n \n [dependency-groups]\n dev = [\"databricks-connect~=16.0\"]\n+\n+[tool.databricks.environment]\n+environment_version = \"4\"\n+\n+# managed by databricks environments setup-local — do not edit\n+[tool.uv]\n+constraint-dependencies = [\n+ \"pyarrow\u003c19\",\n+]\n+# end managed by databricks environments setup-local\n" | ||
| }, | ||
| "phases": [ | ||
| { | ||
| "phase": "preflight", | ||
| "status": "ok" | ||
| }, | ||
| { | ||
| "phase": "resolve", | ||
| "status": "ok" | ||
| }, | ||
| { | ||
| "phase": "fetch", | ||
| "status": "ok" | ||
| }, | ||
| { | ||
| "phase": "merge", | ||
| "status": "ok" | ||
| }, | ||
| { | ||
| "phase": "provision", | ||
| "status": "ok" | ||
| }, | ||
| { | ||
| "phase": "validate", | ||
| "status": "ok" | ||
| } | ||
| ], | ||
| "warnings": [ | ||
| { | ||
| "code": "W_REQUIRES_PYTHON_OVERRIDDEN", | ||
| "message": "requires-python \"\u003e=3.10\" is replaced by the environment's \"\u003e=3.12\"" | ||
| } | ||
| ], | ||
| "error": null, | ||
| "durationMs": [DURATION_MS] | ||
| } |
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 @@ | ||
| # --no-dbconnect is the orthogonal spelling of --constraints-only: it omits the | ||
| # databricks-connect dependency (mode "constraints-only") while still managing | ||
| # requires-python and the [tool.uv] constraints. Existing databricks-connect | ||
| # requirements the user already had are left untouched. | ||
| cat > pyproject.toml <<'PY' | ||
| [project] | ||
| name = "demo" | ||
| requires-python = ">=3.10" | ||
| dependencies = ["databricks-connect==15.1.*"] | ||
|
|
||
| [dependency-groups] | ||
| dev = ["databricks-connect~=16.0"] | ||
| PY | ||
|
|
||
| trace $CLI environments setup-local --serverless-version 4 --no-dbconnect --dry-run --output json |
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,23 @@ | ||
| EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] | ||
|
|
||
| # The script writes pyproject.toml as the merge input; --dry-run leaves it unchanged. | ||
| Ignore = ["pyproject.toml"] | ||
|
|
||
| Env.DATABRICKS_LOCALENV_CONSTRAINT_SOURCE_URL_TEST_OVERRIDE = "$DATABRICKS_HOST" | ||
|
|
||
| [[Server]] | ||
| Pattern = "GET /serverless/serverless-v4/pyproject.toml" | ||
| Response.Body = ''' | ||
| [project] | ||
| requires-python = ">=3.12" | ||
|
|
||
| [dependency-groups] | ||
| dev = ["databricks-connect~=17.2.0"] | ||
|
|
||
| [tool.uv] | ||
| constraint-dependencies = ["pyarrow<19"] | ||
| ''' | ||
|
|
||
| [[Repls]] | ||
| Old = 'uv uv \S+(?: \([^)]+\))?' | ||
| New = 'uv [UV_VERSION]' |
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
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
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 not thread the
--no-constraintsflag through so we don't need a special signal value? (same is true for other signal values used elsewhere)