From 4e655983d50cdcebb0b197333c8f159107d517ee Mon Sep 17 00:00:00 2001 From: davidvujic Date: Sun, 13 Nov 2022 21:41:19 +0100 Subject: [PATCH 1/3] docs: poetry plugin docs --- projects/poetry_polylith_plugin/README.md | 47 ++++++++++++++++++++++- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/projects/poetry_polylith_plugin/README.md b/projects/poetry_polylith_plugin/README.md index a95727f4..61a389a5 100644 --- a/projects/poetry_polylith_plugin/README.md +++ b/projects/poetry_polylith_plugin/README.md @@ -1,8 +1,51 @@ -# poetry-polylith-plugin +# Poetry Polylith Plugin -This is a Python `Poetry` plugin, adding CLI support for the Polylith architecture. +This is a Python `Poetry` plugin, adding CLI support for the Polylith Architecture. +## What's Polylith? +From the [official docs](https://polylith.gitbook.io/polylith/): + +>... Polylith is a software architecture that applies functional thinking at the system scale. It helps us build simple, maintainable, testable, and scalable backend systems. ... + +Polylith is an architecture (with tooling support) originally built for Clojure. +With this Poetry plugin, Polylith is available in Python too! + +### An Architecture well suited for Monorepos +Polylith is using a components-first architecture. Similar to LEGO, components are building blocks. +A component can be shared across apps, tools, libraries, serverless functions and services. + + +### Differences between the Clojure & Python implementations +In the [official docs](https://polylith.gitbook.io/polylith/) for the Clojure implementation, +there is a `interface.clj` file that is used to separate an API from the implementation of a component. + +The Python implementation uses the `__init__.py` to accomplish that. In the Python implementation, the `pyproject.toml` is used to define bases and components. +In particular, the `packages` property is used for that. + +This is an example of the _top level_ `pyproject.toml` used when __developing__. This is where you add all bricks (components and bases). + +``` shell + packages = [ + {include = "development"}, + {include = "my_namespace/my_component", from = "components"}, + {include = "my_namespace/my_example_aws_lambda", from = "bases"}, +] +``` +(using the `loose` theme, see more about that below) + +When creating a project, the _project specific_ `pyproject.toml` will include all the used components and bases. +Note that the packages are referenced relative to the project. This is made possible by the Multiproject Poetry plugin. + +This is where you add the bricks used by the actual project. + +``` shell + packages = [ + {include = "my_namespace/my_component", from = "../../components"}, + {include = "my_namespace/my_example_aws_lambda", from = "../../bases"}, +] +``` + ## Usage ### Install Poetry & plugins From 494df1232efb5ce634e960360c82da8d337d0bff Mon Sep 17 00:00:00 2001 From: davidvujic Date: Sun, 13 Nov 2022 21:41:30 +0100 Subject: [PATCH 2/3] docs: poetry plugin docs --- projects/poetry_polylith_plugin/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/poetry_polylith_plugin/README.md b/projects/poetry_polylith_plugin/README.md index 61a389a5..92a3d035 100644 --- a/projects/poetry_polylith_plugin/README.md +++ b/projects/poetry_polylith_plugin/README.md @@ -35,7 +35,7 @@ This is an example of the _top level_ `pyproject.toml` used when __developing__. (using the `loose` theme, see more about that below) When creating a project, the _project specific_ `pyproject.toml` will include all the used components and bases. -Note that the packages are referenced relative to the project. This is made possible by the Multiproject Poetry plugin. +Note that the packages are referenced relative to the project. This is made possible by the Multiproject Poetry plugin. This is where you add the bricks used by the actual project. From 4eec3ac8d3d83c991a5cae57c3a1d94c6f761933 Mon Sep 17 00:00:00 2001 From: davidvujic Date: Sun, 13 Nov 2022 21:44:50 +0100 Subject: [PATCH 3/3] docs: poetry plugin docs --- README.md | 4 +++- projects/poetry_polylith_plugin/README.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9ff4bc51..3503f5df 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ there is a `interface.clj` file that is used to separate an API from the impleme The Python implementation uses the `__init__.py` to accomplish that. In the Python implementation, the `pyproject.toml` is used to define bases and components. In particular, the `packages` property is used for that. -This is an example of the top level `pyproject.toml` used during __development__. +This is an example of the _top level_ `pyproject.toml` used when _developing_. This is where you add all bricks (components and bases). ``` shell packages = [ @@ -41,6 +41,8 @@ This is an example of the top level `pyproject.toml` used during __development__ When creating a project, the project specific `pyproject.toml` will include all the used components and bases. Note that the packages are referenced relative to the project. +This is where you add the bricks used by the actual project. + ``` shell packages = [ {include = "my_namespace/my_component", from = "../../components"}, diff --git a/projects/poetry_polylith_plugin/README.md b/projects/poetry_polylith_plugin/README.md index 92a3d035..e1f2b51a 100644 --- a/projects/poetry_polylith_plugin/README.md +++ b/projects/poetry_polylith_plugin/README.md @@ -23,7 +23,7 @@ there is a `interface.clj` file that is used to separate an API from the impleme The Python implementation uses the `__init__.py` to accomplish that. In the Python implementation, the `pyproject.toml` is used to define bases and components. In particular, the `packages` property is used for that. -This is an example of the _top level_ `pyproject.toml` used when __developing__. This is where you add all bricks (components and bases). +This is an example of the _top level_ `pyproject.toml` used when _developing_. This is where you add all bricks (components and bases). ``` shell packages = [