Python tooling support for the Polylith Architecture
Project description
Python tooling for Polylith
A command line interface that adds tooling support for the Polylith Architecture in Python.
Documentation
Have a look at the documentation. You will find installation, setup, usage guides and more.
Quick start
Poetry user? For Poetry, the recommended setup is to install the poetry-polylith-plugin.
Read more about Poetry in the documentation.
Setup for Hatch users
Create a directory for your code, initialize it with git and setup the basics with hatch:
git init
hatch new --init
Add the Polylith CLI as a dev dependency in pyproject.toml:
[tool.hatch.envs.default]
dependencies = ["polylith-cli"]
Add configuration for a local virtual environment in the pyproject.toml:
[tool.hatch.envs.default]
type = "virtual"
path = ".venv"
python = "3.12" # your preferred version here
Make Hatch aware of the Polylith structure, by adding this to the pyproject.toml:
[tool.hatch.build]
dev-mode-dirs = ["components", "bases", "development", "."]
Next: create a Polylith workspace, with a basic Polylith folder structure.
The poly command is now available in the local virtual environment.
You can run commands in the context of hatch run to make Polylith aware of the development environment.
hatch run poly create workspace --name my_namespace --theme loose
Ready for coding!
Add components, bases and projects:
hatch run poly create component --name my_component
hatch run poly create base --name my_example_endpoint
hatch run poly create project --name my_example_project
For details, have a look at the documentation. There, you will find guides for setup, migration, packaging, available commands, code examples and more.
Setup for PDM users
Create a directory for your code, initialize it with git and setup the basics with PDM.
git init
pdm init -n --backend pdm-backend minimal
Add a workspace hook
Make PDM aware of the Polylith structure, by adding the pdm-polylith-workspace hook to the newly created pyproject.toml.
The build hook will add an additional pth file to the virtual environment,
with paths to the Polylith source code folders (bases, components).
[build-system]
requires = ["pdm-backend", "pdm-polylith-workspace"]
build-backend = "pdm.backend"
Add the polylith-cli
Add the Polylith CLI as a dev dependency and setup the virtual environment paths.
touch README.md
pdm add -d polylith-cli
pdm install
Next: create a Polylith workspace, with a basic Polylith folder structure.
The poly command is now available in the local virtual environment.
You can run commands in the context of pdm run to make Polylith aware of the development environment.
pdm run poly create workspace --name my_namespace --theme loose
Ready for coding!
Add components, bases and projects:
pdm run poly create component --name my_component
pdm run poly create base --name my_example_endpoint
pdm run poly create project --name my_example_project
For details, have a look at the documentation. There, you will find guides for setup, migration, packaging, available commands, code examples and more.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file polylith_cli-1.1.1.tar.gz.
File metadata
- Download URL: polylith_cli-1.1.1.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b857a8edc36f57e006f5ba377b9675212dffe523b919495b2155c09cad2fd25
|
|
| MD5 |
131138316dc2dd02a884e318b448d210
|
|
| BLAKE2b-256 |
206b3e012467f01bef46d88418d3c0336788ca7002bd7e058d763ea530c3fd0e
|
File details
Details for the file polylith_cli-1.1.1-py3-none-any.whl.
File metadata
- Download URL: polylith_cli-1.1.1-py3-none-any.whl
- Upload date:
- Size: 40.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c583fc894e439f66c72db1d5e03a315a47d48300ec4fb6eabe9a06ed8edf056
|
|
| MD5 |
f76fc337fcd2b5ebaf7031411bad9a91
|
|
| BLAKE2b-256 |
76dec166402b8bd8bda6fc30164bf4ad7e8f47e6bb31e64b1a1ba92e1d09eba6
|