Skip to content

carderne/una-example

Repository files navigation

una-example

This is an example of an una monorepo.

What this is for:

  • uv is the best way to use Python, and it has some monorepo/workspace support.
  • If your build artifacts are Dockerfiles, uv is probably enough.
  • But if you want to build Python wheels or similar in monorepos, read on!

Read more about una:

About

This repository is basically the result of the following steps:

uv init una-example
cd una-example
git init
uv add --dev una
uv run una create workspace
uv sync
uv run una sync
uv add --dev basedpyright pytest

And then some extra settings added to all the pyproject.toml files to get Pyright and Pytest to play nice.

Commands

Sync the una dependency graph (that is, resolve all dependencies between packages in the monorepo):

uv run una sync

Formatting, linting etc (these are specified at the top of the root pyproject.toml).

make fmt
make lint
make check
make test

make all

Building

Build wheels (outputs to dist/):

make build

Docker

make build-docker
docker run --rm -p 8000:8000 -it example

Then curl the running server:

$ curl localhost:8000

┌────────────────┐
│Hello from Una! │
└────────────────┘
               \
                \
                  ^__^
                  (oo)\_______
                  (__)\       )\/\
                      ||----w |
                      ||     ||

About

Example of an una monorepo

Topics

Resources

License

Stars

Watchers

Forks