Skip to content

Commit 3ebfb6b

Browse files
authored
docs: Poetry plugin docs and clarifications (#27)
* docs: poetry plugin docs and clarifications
1 parent 1e3537a commit 3ebfb6b

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ there is a `interface.clj` file that is used to separate an API from the impleme
2727
The Python implementation uses the `__init__.py` to accomplish that. In the Python implementation, the `pyproject.toml` is used to define bases and components.
2828
In particular, the `packages` property is used for that.
2929

30-
This is an example of the top level `pyproject.toml` used during __development__.
30+
This is an example of the _top level_ `pyproject.toml` used when _developing_. This is where you add all bricks (components and bases).
3131

3232
``` shell
3333
packages = [
@@ -41,6 +41,8 @@ This is an example of the top level `pyproject.toml` used during __development__
4141
When creating a project, the project specific `pyproject.toml` will include all the used components and bases.
4242
Note that the packages are referenced relative to the project.
4343

44+
This is where you add the bricks used by the actual project.
45+
4446
``` shell
4547
packages = [
4648
{include = "my_namespace/my_component", from = "../../components"},

projects/poetry_polylith_plugin/README.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,51 @@
1-
# poetry-polylith-plugin
1+
# Poetry Polylith Plugin
22

3-
This is a Python `Poetry` plugin, adding CLI support for the Polylith architecture.
3+
This is a Python `Poetry` plugin, adding CLI support for the Polylith Architecture.
44

55

6+
## What's Polylith?
7+
From the [official docs](https://polylith.gitbook.io/polylith/):
8+
9+
>... Polylith is a software architecture that applies functional thinking at the system scale. It helps us build simple, maintainable, testable, and scalable backend systems. ...
10+
11+
Polylith is an architecture (with tooling support) originally built for Clojure.
12+
With this Poetry plugin, Polylith is available in Python too!
13+
14+
### An Architecture well suited for Monorepos
15+
Polylith is using a components-first architecture. Similar to LEGO, components are building blocks.
16+
A component can be shared across apps, tools, libraries, serverless functions and services.
17+
18+
19+
### Differences between the Clojure & Python implementations
20+
In the [official docs](https://polylith.gitbook.io/polylith/) for the Clojure implementation,
21+
there is a `interface.clj` file that is used to separate an API from the implementation of a component.
22+
23+
The Python implementation uses the `__init__.py` to accomplish that. In the Python implementation, the `pyproject.toml` is used to define bases and components.
24+
In particular, the `packages` property is used for that.
25+
26+
This is an example of the _top level_ `pyproject.toml` used when _developing_. This is where you add all bricks (components and bases).
27+
28+
``` shell
29+
packages = [
30+
{include = "development"},
31+
{include = "my_namespace/my_component", from = "components"},
32+
{include = "my_namespace/my_example_aws_lambda", from = "bases"},
33+
]
34+
```
35+
(using the `loose` theme, see more about that below)
36+
37+
When creating a project, the _project specific_ `pyproject.toml` will include all the used components and bases.
38+
Note that the packages are referenced relative to the project. This is made possible by the Multiproject Poetry plugin.
39+
40+
This is where you add the bricks used by the actual project.
41+
42+
``` shell
43+
packages = [
44+
{include = "my_namespace/my_component", from = "../../components"},
45+
{include = "my_namespace/my_example_aws_lambda", from = "../../bases"},
46+
]
47+
```
48+
649
## Usage
750

851
### Install Poetry & plugins

0 commit comments

Comments
 (0)