YAMP is an opinionated Poetry (>= 2.0.0) plugin that helps managing a "pinned" monorepo with centralized versioning.
The default behavior is that the Single Source of Version Truth is the root pyproject.toml.
Warning
🚧 WIP, not ready yet!
Some core features as path-dependency rewrite are missing.
Important
YAMP is tailored to a very specific need, so it may not be a good fit for a more general "monorepo" approach.
It may be suitable if:
-
You're maintaining multiple related but decoupled Python packages (e.g., internal libs) in one repo.
-
You want tight version control and easy building without complex/custom tooling.
-
You want path dependency rewriting to pin inter-project dependencies.
- proper test matrix (Poetry)
- WIP: path dependency rewrite
- projects-install/init command
- ...
.
├───pyproject.toml <== root pyproject.toml
┆
└───<projects-dir> <== projects directory
|
├───proj-1
│ ├───pyproject.toml
│ └─── ...
├───proj-2
│ ├───pyproject.toml
┆ └─── ...
└───proj-3
├───pyproject.toml
└─── ...
[tool.poetry-yet-another-monorepo-plugin]
projects-dir = "src"
exclude-projects = [
"proj-c",
]| Setting | Description | Default |
|---|---|---|
projects-dir |
The directory where projects are located. | "projects" |
exclude-projects |
A list of regex patterns to match against project names for exclusion. | [] |
Important
- All commands support the
-v|vv|vvvverbosity options. - All commands that apply changes support a
--dry-runflag to preview the changes without committing them.
Lists all projects in the monorepo projects-dir.
This is the equivalent of calling poetry build --project <proj-dir> for every project in projects-dir, with the difference that the build version is pinned to the version
in the root pyproject.toml. The version in each project's individual pyproject.toml is therefore ignored.
If --sync-versions is specified, the version of every project is synced with the build version.
The command also supports the same options as
poetry build.
Note
If a PEP-621 [project] table is found, the version will be read from project.version; otherwise, it will fall back to tool.poetry.version for retro-compatibility.
Tip
The build version can be overridden by setting one of the following:
--version-overrideoption (takes precedence)YAMP_VERSION_OVERRIDEenvironment variable
Syncs the version of all projects in the monorepo to the version in the root pyproject.toml, from either project.version or tool.poetry.version (checked in this order).
Tip
The version can be overridden by setting one of the following:
--version-overrideoption (takes precedence)YAMP_VERSION_OVERRIDEenvironment variable
Caution
The version is written to the pyproject.toml of every (non-excluded) project in the projects-dir.
If a PEP-621 [project] table is found, the version will be written to project.version; otherwise, to tool.poetry.version for retro-compatibility.