Skip to content

sandeep-selvaraj/pascal

Repository files navigation

pascal

PyPI version CI License: MIT

Fast Python monorepo manager powered by Rust and UV.

Pascal handles workspace scaffolding, dependency wiring, and UV workspace sync — so you can focus on code, not configuration.

Documentation · Installation · Quickstart · Commands

Heavily inspired by Polylithpackages map to Polylith's components, apps to its bases, brought to the Python/UV ecosystem with a minimal footprint.


Installation

uv tool install pascal-cli   # recommended
pipx install pascal-cli
pip install pascal-cli
pascal --version

Quickstart

# Bootstrap a workspace
mkdir shop && cd shop
pascal init shop

# Add a library and an app
pascal create package cart
pascal create app storefront

# Wire them together
pascal add cart --to storefront
uv sync

# Validate and inspect
pascal check
pascal info
pascal test

Workspace layout

After the quickstart above, your workspace looks like this:

shop/
  pascal.toml          # workspace manifest
  pyproject.toml       # UV workspace root — managed by pascal
  uv.lock              # lockfile — commit to git
  packages/
    cart/
      pyproject.toml
      src/cart/__init__.py
      tests/test_cart.py
  apps/
    storefront/
      pyproject.toml   # depends on cart
      src/storefront/__init__.py
      src/storefront/main.py
      tests/test_storefront.py

pascal.toml

[workspace]
name = "shop"
python = "3.12"
description = "My Python monorepo"

# Optional — pascal auto-discovers from packages/ and apps/ if omitted
packages = ["packages/cart"]
apps     = ["apps/storefront"]

apps/storefront/pyproject.toml (after pascal add cart --to storefront)

[project]
name = "storefront"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = ["cart"]

[project.scripts]
storefront = "storefront.main:main"

[tool.uv.sources]
cart = { workspace = true }

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

Command reference

Command Description
pascal init [name] Bootstrap a new workspace
pascal create package <name> Scaffold a reusable library
pascal create app <name> Scaffold a deployable app
pascal add <pkg> --to <app> Add a workspace package as a dependency
pascal info Print workspace overview
pascal deps [--graph] Show the dependency tree
pascal check Validate workspace health
pascal diff [--since <ref>] Show changed packages since a git ref
pascal test [--changed] [name] Run tests via UV
pascal build <app> Build an app wheel
pascal run <app> [-- args] Run an app entry-point
pascal sync Regenerate UV workspace config

Development

Prerequisites

Tool Purpose
Rust ≥ 1.75 Compile the binary
pre-commit Git hook runner (uv tool install pre-commit)
maturin (optional) Test PyPI packaging locally

Build

git clone https://github.com/sandeep-selvaraj/pascal
cd pascal
cargo build

Test

cargo test          # unit + integration
cargo test --lib    # unit tests only
cargo test --test integration  # integration tests only

Integration tests in tests/integration.rs spawn the real binary against tempfile directories — no mocking.

Lint and format

cargo fmt
cargo clippy -- -D warnings

Pre-commit hooks

Install once after cloning:

pre-commit install

Every git commit will then run cargo fmt and cargo clippy automatically.

Test PyPI packaging

pip install maturin
maturin build
pip install target/wheels/*.whl
pascal --version

Serve docs locally

pip install zensical
zensical serve

License

MIT — see LICENSE.

About

Your one stop package for Python Monorepos.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages