Confusion about the local development flow #199
-
I'm experimenting with Polylith here and it's not clear how to develop and run things locally, so I would appreciate some guidelines here. With this repository checked out locally, I'm running
Now, if I want to run a project (or base) locally to ensure that it works correctly, I'm using what this docs page states:
With the example project structure, it is possible to run it as the following:
The problem I'm having is that if I would go to the diff --git a/bases/example/greet_api/core.py b/bases/example/greet_api/core.py
index 67ff900..7e797f5 100644
--- a/bases/example/greet_api/core.py
+++ b/bases/example/greet_api/core.py
@@ -1,3 +1,5 @@
+raise ValueError()
+
from example import greeting
from example.log import get_logger
from fastapi import FastAPI then executing the It happens because during the
Because of that, local development flow is not possible anymore, as any changes you make to your source code are not picked up by Python anymore, since the installed package in the virtual environment takes precedence. Rye allows us to make the root project a virtual one: index eeca26e..ec74e4b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -20,6 +20,7 @@ dependencies = [
[tool.rye]
managed = true
+virtual = true
dev-dependencies = [
"mypy~=1.8.0",
"polylith-cli", That would stop us from having our own project installed into the virtual environment, but, of course,
I feel like I'm missing some obvious way to run things locally and at the same time being able to change the files, any help would be greatly appreciated! :) Side noteExample repo at Show the traceback
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @svartalf and thank you for the very detailed description, this is much appreciated 🙏 Yesterday I found a bug in the Rye The docs are also updated with the correct information since yesterday. I have tried to reproduce what you describe with the You can also append the If you haven't already, can you delete the |
Beta Was this translation helpful? Give feedback.
Hi @svartalf and thank you for the very detailed description, this is much appreciated 🙏
Yesterday I found a bug in the Rye
pyproject.toml
at the root of the workspace - where I accidentally had added the hatch build-hook. After some testing and experimenting in #198 we finally found this little typo causing so much trouble. I think I had mixed things up between Rye and PDM that needs a hook at the top level too (and I am not using Rye on a regular basis).The docs are also updated with the correct information since yesterday.
I have tried to reproduce what you describe with the
raise ValueError
but with the latest version I think it works as it should: after altering the base and re-runn…