Skip to content

build: turn the repo into a Turborepo monorepo with uv workspaces #125

Description

@userAugustos

Goal

Make the repository a real monorepo. Turborepo is the build system. uv workspaces hold the Python packages. Every command runs from the root through Turborepo.

This is the first PR of a stack. It covers layout, workspace, and build system only. It does not fix code, tests, or CI coverage.

Acceptance Criteria

  • The root holds package.json, bun.lock, turbo.json, a virtual pyproject.toml, and uv.lock.
  • packages/core holds the runtime distribution canyonos-core. packages/cli holds the CLI distribution canyonos. Both are uv workspace members.
  • Turborepo discovers both Python packages from the uv workspace with its native Python support. No Python package carries a package.json.
  • bun install and uv sync from the root prepare the whole repo. There is one shared virtual environment at the root.
  • bun run lint, bun run typecheck, bun run check, bun run format, bun run test, and bun run build run from the root and go through turbo run.
  • bun run build produces the wheel and sdist of both packages.
  • The canyonos console script resolves from the root environment.
  • Each tool version is pinned in one place: Bun in package.json, Turborepo in bun.lock, uv in the root pyproject.toml, Ruff and ty in the dev group.
  • uv.lock is regenerated with the pinned uv, tracked, and no longer listed in .gitignore.
  • The core image builds from packages/core. The core image workflow watches the new paths.
  • The CLI release workflows build the binaries and the wheel and publish from packages/cli.
  • The CI workflow runs lint, format, and type checks through the root commands.
  • README files, the install script, and the architecture docs point to the new paths.
  • Source files change only where the move requires a new path.

Guidance

Known problems accepted in this PR

  • Core test modules that import the generated gRPC stubs or gpu_metrics do not collect outside the Docker image. This is the state today. bun run test is red for core. A later PR in the stack fixes collection.
  • Tests stay in the root tests directory and run as one task. A later PR moves them into the packages.
  • CI does not run pytest. This is the state today. A later PR adds it.
  • The CLI auto-bump workflow edits the CLI version without refreshing uv.lock. This PR adds the lock refresh to the bump step. A better release flow is a later PR.
  • Turborepo Python support is experimental. It needs a future flag and uv 0.12 or newer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions