Skip to content

feat: add hm.py.uv toolchain + dogfood CI pipeline#13

Merged
markovejnovic merged 14 commits into
mainfrom
ci/dogfood-here
May 24, 2026
Merged

feat: add hm.py.uv toolchain + dogfood CI pipeline#13
markovejnovic merged 14 commits into
mainfrom
ci/dogfood-here

Conversation

@markovejnovic
Copy link
Copy Markdown
Contributor

Summary

  • hm.py.uv() namespace in both Python and TypeScript DSLs — a dedicated uv-managed Python project toolchain with run(), build(), lock_check()/lockCheck(), and publish() methods beyond the existing test/lint/fmt/typecheck surface.
  • .harmont/ci.py — dogfood pipeline that uses hm.py.uv() for Python DSL checks and hm.rust() for Cargo workspace build/test/clippy/fmt.

New API

Python DSL:

project = hm.py.uv(path="dsls/harmont-py")
project.test()       # uv run pytest
project.lint()       # uv run ruff check .
project.run("cmd")   # uv run <cmd> (escape hatch)
project.build()      # uv build
project.lock_check() # uv lock --check

TypeScript DSL:

const project = py.uv({ path: "." });
project.test();      // uv run pytest
project.run("cmd");  // uv run <cmd>
project.lockCheck(); // uv lock --check

Existing hm.python() is unchanged — backwards compatible.

Pipeline DAG

scratch ─ :rust: apt-base ─ :rust: rustup ──┬─ build
                                             ├─ test
                                             ├─ clippy
                                             └─ fmt

scratch ─ :python: apt ─ uv-install ─ uv-sync ─┬─ lint
                                                 ├─ fmt
                                                 ├─ typecheck
                                                 └─ test

Test plan

  • 23 new Python DSL tests (test_py_uv.py) — all pass, 399 total no regressions
  • 19 new TypeScript DSL tests (py/uv.test.ts) — all pass, 278 total no regressions
  • tsc --noEmit clean
  • ruff check clean on new files
  • CI green

New py.uv sub-namespace for uv-managed Python projects.
Adds run(), build(), lock_check(), publish() beyond the
existing test/lint/fmt/typecheck surface.

hm.python() stays unchanged for backwards compat.
Mirrors the Python DSL's hm.py.uv() — uv-managed Python projects
with run(), build(), lockCheck(), publish() methods.
Uses hm.py.uv() for Python DSL checks and hm.rust() for
workspace build/test/clippy/fmt. Demonstrates the new py.uv
namespace with run() escape hatch for custom pytest args.
Fix RUF022 (unsorted __all__) by moving "py" to correct
alphabetical position.

Add TypeScript variant of the dogfood CI pipeline alongside
the existing Python one.
Builds hm from source, installs harmont-py into system Python,
and executes .harmont/ci.py through the hm binary — the repo
now CI-tests itself through its own tool.
Drop fmt() (normal CI doesn't check formatting) and scope mypy
to package dir only (normal CI runs mypy harmont, not mypy .).
- typecheck(paths="src") or typecheck(paths=["src", "tests"]) to
  scope mypy to specific directories (defaults to "." as before)
- Applied to PythonToolchain and UvProject in both Python and TS DSLs
- ruff format across all harmont-py source and test files
- Dogfood pipelines now use typecheck(paths="harmont")
Move use-items before statements (items_after_statements) and
remove trailing commas in macro args (unnecessary_trailing_comma).
@markovejnovic markovejnovic marked this pull request as ready for review May 24, 2026 07:48
The full cargo test runs integration tests that need python3,
which isn't available in the bare Rust Docker container.
RustToolchain has no run() method; use installed step directly
with cargo env sourcing.
@markovejnovic markovejnovic merged commit a008c99 into main May 24, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant