[VPEX][6/8] Add local-env uv backend and hidden CLI command#5832
Open
rugpanov wants to merge 1 commit into
Open
[VPEX][6/8] Add local-env uv backend and hidden CLI command#5832rugpanov wants to merge 1 commit into
rugpanov wants to merge 1 commit into
Conversation
Contributor
Waiting for approvalBased on git history, these people are best suited to review:
Eligible reviewers: Suggestions based on git history. See OWNERS for ownership rules. |
Sixth in the stacked series. Wires the engine to a runnable CLI command, registered Hidden so it does not appear in help or completion until the final unveil PR (it is invocable for dogfooding in the meantime). - libs/localenv/uv.go: the uv implementation of the PackageManager interface (discover/install uv, install Python, uv sync, seed pip, validate the venv), plus the pip.conf -> UV_INDEX_URL bridge for Databricks-managed machines. - cmd/localenv: the command tree matching the target path "local-env python sync" — a top group (local-env), a python subgroup, and the sync verb. Parent nodes use root.ReportUnknownSubcommand so an unknown subcommand errors while a bare group shows help. sync resolves flags/bundle target, builds the Pipeline with the uv manager, and renders text or --json. - cmd/cmd.go: register the group (Hidden:true). The sync verb rejects stray positional args (cobra.NoArgs) rather than silently ignoring them, since the target is chosen via flags. Job compute resolution reads job-level environments/job_clusters; task-level compute is out of scope and returns an actionable error pointing at --cluster/--serverless. This is the first layer reachable from main, so it makes the whole libs/localenv package live for the deadcode checker without any pragmas. Build, unit tests, lint, and deadcode are clean; the hidden three-level command was smoke-tested end to end (help at each level, unknown-subcommand errors, flags). Co-authored-by: Isaac
734b5f5 to
2fd09fe
Compare
Collaborator
Integration test reportCommit: 2fd09fe
22 interesting tests: 14 SKIP, 7 RECOVERED, 1 flaky
Top 5 slowest tests (at least 2 minutes):
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Context
PR 6 of 8 in the stacked
databricks local-env python syncseries (see #5823 for the full plan). Stacked on #5828 — review PRs 1–5 first; this PR's diff is the seven files below. This PR wires the engine to a runnable CLI command, registeredHidden: trueso it does not appear in help or completion until the final unveil PR (#8). It is invocable by name for dogfooding in the meantime, so nothing user-facing changes yet.What this PR contains
libs/localenv/uv.go(+uv_test.go) — the uv implementation of thePackageManagerinterface: discover/install uv, install the Python minor,uv sync, seed pip into the venv, and validate the result. Includes thepip.conf→UV_INDEX_URLbridge for Databricks-managed machines where pypi.org is blocked.cmd/localenv/— the command tree matching the target pathlocal-env python sync:localenv.go— thelocal-envgroup (Hidden: true) and thepythonsubgroup; both parent nodes useroot.ReportUnknownSubcommandso an unknown subcommand errors while a bare group shows help.sync.go— thesyncverb: target/mode flags, bundle-target resolution, constraint-source precedence (flag → env → default), builds thePipelinewith the uv manager, and renders text or--json.compute.go— the SDK adapter implementingComputeClient.output.go— text/--jsonrendering of the pipelineResult.cmd/cmd.go— registers the group.All three Cobra
Usevalues and the--jsoncommandfield come from the single command-path constants inlibs/localenv(CommandGroup/CommandSubgroup/CommandVerb/CommandName); no code literal re-spells the path.First layer reachable from main
Because this wires the package into
main, it makes the wholelibs/localenvpackage live for thedeadcodechecker with no//deadcode:allowpragmas. Build, unit tests, lint, deadcode, and gofmt are all clean. The hidden three-level command was smoke-tested end to end: hidden from top-level help; help works at each level; unknown subcommands exit non-zero; a bare group shows help; flags and mutual-exclusion behave.Unit tests for
cmd/localenv/are intentionally deferred to the acceptance-test PR (#7), per the repo convention that user-visible CLI output is covered by acceptance tests.This pull request and its description were written by Isaac.
This PR was created with GitHub MCP.