Replies: 4 comments 1 reply
-
Hi @maxalbert, thank you for the detailed report! ⭐ I think that the I should probably clarify this part in the docs. The open questions:
|
Beta Was this translation helpful? Give feedback.
-
I have added a new sub-section called |
Beta Was this translation helpful? Give feedback.
-
(I will move this to Discussions and Q&A) |
Beta Was this translation helpful? Give feedback.
-
@DavidVujic Many thanks for the swift response and for adding this docs section. IMHO it really makes the setup process a lot clearer. Much appreciated. I have a tangentially related question (which I'm happy to ask in a separate thread if more appropriate). While going through the setup docs and trying to better understand how everything works together, I was trying to import different components etc. from within an interactive IPython console. Unfortunately, due to the use of namespace packages the tab completion was quite limited, which made the exploration more cumbersome than I had hoped. Can you think of any ways to improve this? A quick web search for didn't result in any obvious ways to add tab completion for namespace packages, but I was wondering if it was possible to dynamically add support via some plugin or build hook (for example by dynamically creating a |
Beta Was this translation helpful? Give feedback.
-
Hi @DavidVujic, first of all huge thanks for introducing the Polylith architecture to the Python community and for your invaluable work on the related tooling.
Describe the bug
I recently discovered the Polylith architecture and read up about its concepts in the Clojure-focused GitBook and in your Python-focused documentation.
I wanted to try it out with a hands-on example and followed the steps in the Setup section (using
uv
) to create a minimal Polylith workspace.However, I struggled to get the development workflow going in the way I expected. I'm unsure if my expectations were wrong or if some crucial steps are missing in the setup documentation to get to a fully functioning development project.
To Reproduce
Note: for reference, a repo with the workspace structure resulting from the steps below is available here.
Start in an empty directory and make sure that
python
anduv
are available. I'm using the following versions:Then follow the steps in the setup guide:
$ uv init --name=polylith-bug-report $ uv add --dev polylith-cli $ uv add --dev ipython # optional, for convenience $ uv run poly create workspace --name bug_report --theme loose
Now edit pyproject.toml according to the instructions here by adding the following sections:
Finally, run:
Expected behavior
At this stage, I expected to be able to enter a Python console and import the
bug_report
module. However:It turns out that if I create a new component then the import does work:
However, this is quite nonintuitive. It actually took me quite a few attempts of debugging and experimenting with different things to realise that this was all that's needed.
I'm still not sure if I'm missing any further setup steps, for example in order to get the development project fully set up and working. I have included a couple of my open questions below.
Desktop (please complete the following information):
Additional context / Further questions
As indicated above, I'm not sure whether completing the setup steps is sufficient for a fully working Polylith workspace. Open questions:
The docs section on Projects & pyproject.toml mentions that the project-specific
pyproject.toml
files needhatch-polylith-bricks
as an additional build system dependency, and also require the section[tool.hatch.build.hooks.polylith-bricks]
to be present (even if it is empty). Is this also necessary to set up the development project in the toplevelpyproject.toml
file?Do I need to run
poly sync
to complete the workspace setup? If I do this (after creating thedummy
component above), the following section is added to the toplevelpyproject.toml
file:However, I think that I can import new components (and presumably bases, although I haven't tried this) without this section being present. Does it make a difference?
Many thanks for reading and any clarifications!
Beta Was this translation helpful? Give feedback.
All reactions