mirror of https://github.com/databricks/cli.git
Add support for extras to the labs CLI (#2288)
## Changes Added support for extras / optional Python dependencies in the labs CLI. Added new `extras` field under install. Example: ```yaml install: script: install.py extras: cli ``` Resolves: #2257 ## Tests Manual test
This commit is contained in:
parent
5c90752797
commit
27caf413f2
|
@ -32,6 +32,7 @@ type hook struct {
|
||||||
RequireDatabricksConnect bool `yaml:"require_databricks_connect,omitempty"`
|
RequireDatabricksConnect bool `yaml:"require_databricks_connect,omitempty"`
|
||||||
MinRuntimeVersion string `yaml:"min_runtime_version,omitempty"`
|
MinRuntimeVersion string `yaml:"min_runtime_version,omitempty"`
|
||||||
WarehouseTypes whTypes `yaml:"warehouse_types,omitempty"`
|
WarehouseTypes whTypes `yaml:"warehouse_types,omitempty"`
|
||||||
|
Extras string `yaml:"extras,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *hook) RequireRunningCluster() bool {
|
func (h *hook) RequireRunningCluster() bool {
|
||||||
|
@ -258,6 +259,10 @@ func (i *installer) setupPythonVirtualEnvironment(ctx context.Context, w *databr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
feedback <- "Installing Python library dependencies"
|
feedback <- "Installing Python library dependencies"
|
||||||
|
if i.Installer.Extras != "" {
|
||||||
|
// install main and optional dependencies
|
||||||
|
return i.installPythonDependencies(ctx, fmt.Sprintf(".[%s]", i.Installer.Extras))
|
||||||
|
}
|
||||||
return i.installPythonDependencies(ctx, ".")
|
return i.installPythonDependencies(ctx, ".")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,11 @@
|
||||||
},
|
},
|
||||||
"warehouse_types": {
|
"warehouse_types": {
|
||||||
"enum": [ "PRO", "CLASSIC", "TYPE_UNSPECIFIED" ]
|
"enum": [ "PRO", "CLASSIC", "TYPE_UNSPECIFIED" ]
|
||||||
|
},
|
||||||
|
"extras": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^([^,]+)(,([^,]+))*$",
|
||||||
|
"default": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,6 +8,7 @@ install:
|
||||||
warehouse_types:
|
warehouse_types:
|
||||||
- PRO
|
- PRO
|
||||||
script: install.py
|
script: install.py
|
||||||
|
extras: ""
|
||||||
entrypoint: main.py
|
entrypoint: main.py
|
||||||
min_python: 3.9
|
min_python: 3.9
|
||||||
commands:
|
commands:
|
||||||
|
|
Loading…
Reference in New Issue