Commit Graph

10 Commits

Author SHA1 Message Date
Gleb Kanterov fc9544e6d9
[Python] Fix issues with multiple mutators (#2509)
## Changes
Fix issues with bundles using multiple mutators. 

Previously, we didn't correctly chain output between them.

## Tests
- Unit tests
- Acceptance tests in https://github.com/databricks/cli/pull/2493
2025-03-18 18:41:14 +00:00
Gleb Kanterov d2ec690585
[Python] Fix issues with multiple resource loaders (#2511)
## Changes
Fix issues with multiple resource loaders. 

Previously, we discarded outputs of all loaders except the last one.
That worked well if there is only a single resource loader.

## Tests
- Unit tests
- Acceptance tests in https://github.com/databricks/cli/pull/2493
2025-03-18 11:56:36 +00:00
Gleb Kanterov 814168398d
[Python] Configure Sphinx docs (#2496)
## Changes
Configure Sphinx docs for Python code.

There is a lot of customization for Sphinx output to make complex type
signatures readable:
- Type dicts are not documented, because they exactly follow dataclass
schema
- Variables are excluded from type signatures

After that, when the rest of the code is ready, we can automatically
publish docs into gh-pages.

## Tests
Adds CI check
2025-03-17 09:18:33 +00:00
Gleb Kanterov 7c1604405f
[Python] Add generated resource code (#2487)
## Changes
Add Python code generated from `databricks bundle schema`

## Tests
Add a few tests for special cases in the generated code
2025-03-17 09:03:17 +00:00
Gleb Kanterov afa253c431
[Python] Clarify rationale for mutator design (#2488)
## Changes
Clarify rationale for design of `@job_mutator`
2025-03-14 09:41:42 +00:00
Gleb Kanterov 036061f8b5
[Python] Reformat variable regex (#2484)
## Changes
Reformat variable regex in Python code to follow Golang. The effective
regex is not changed.

## Why
We need to keep both regexes in sync.

## Tests
Using existing tests and manually inspecting resulting regex.
2025-03-13 14:12:37 +00:00
Gleb Kanterov 491af65584
[Python] Simplify conf loading (#2486)
## Changes
Simplify conf loading in Python code

## Tests
Unit tests
2025-03-13 11:44:35 +00:00
Gleb Kanterov 8fe05d9ba6
[Python] Clarify mutators behaviour (#2485)
## Changes

Clarify the behavior of Python mutators.
2025-03-13 12:28:32 +01:00
Gleb Kanterov fbf52ce821
[Python] Add databricks.bundles.core (#2469)
## Changes
Add databricks.bundles.core package to experimental/python.

It contains an implementation of resource-independent code for Python
support. As a follow-up, we will add Python code generated using bundle
schema.

## Tests
Unit tests
2025-03-13 10:18:46 +00:00
Gleb Kanterov 36431ef161
Setup CI for Python code (#2448)
## Changes
Add new CI jobs for testing Python code.

These jobs are separate from Golang code because they are executed
against a matrix of Python versions, and OS versions are not relevant.
We will get coverage with OS versions using acceptance tests. In
addition, we don't need to run these tests unless any of the Python code
is modified.

We use uv as a package manager to provision all CI tools:
- pyright to typecheck
- ruff to lint and format

experimental/python contains a Makefile with target similar to
repository root:
- make fmt
- make lint
- make build

## Tests
Using CI
<!-- How have you tested the changes? -->

---
NO_CHANGELOG=true
2025-03-11 10:29:36 +00:00