-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mono-repo with multiple linked modules #189
Comments
Hi! I just tested this out, and I'm not sure there's a good way to make it work :/ There are a few problems:
I tried doing this, but it doesn't work, because Poetry has already analyzed the versions before this substitution occurs: [[tool.poetry-dynamic-versioning.substitution.folders]]
path = "."
files = ["pyproject.toml"]
patterns = ["(my-sdk = \")0.0.0(\")"] It should work if you relax the dependency constraint, but that depends on what backwards compatibility guarantees you're comfortable making: [tool.poetry.dependencies]
my-sdk = ">= 1.0.0, < 2.0.0" Maybe the plugin could directly modify the version constraints in memory after Poetry has already parsed them, but I haven't explored how complicated/feasible that would be. |
Unfortunately the dependency constraints are strict.
I used to have the SDK and CLI as separate packages and repos, but they’re
so tightly integrated that I had to ensure the version was always the same
between both and hence more to a mono-repo.
I’ve also tried to change the sdk to just use the local path and not
specify a version constraint
```
[tool.poetry.dependencies]
my-sdk = { path = "../my-sdk", develop = true }
python = "^3.10"
click = "^8.1.3"
[tool.poetry.scripts]
cli = "my_cli.app:safe_entry_point"
[tool.poetry.group.dev.dependencies]
```
However I have no idea what poetry does when it comes to building /
publishing it so that seems incorrect…
Fabre Lambeau
…On Sat, 17 Aug 2024 at 00:10, Matthew Kennerly ***@***.***> wrote:
Hi! I just tested this out, and I'm not sure there's a good way to make it
work :/ There are a few problems:
- Poetry resolves the dependency version constraints before the plugin
performs text substitution
- Poetry tries to resolve all groups together:
python-poetry/poetry#1168
<python-poetry/poetry#1168>
I tried doing this, but it doesn't work, because Poetry has already
analyzed the versions before this substitution occurs:
[[tool.poetry-dynamic-versioning.substitution.folders]]path = "."files = ["pyproject.toml"]patterns = ["(my-sdk = \")0.0.0(\")"]
It should work if you relax the dependency constraint, but that depends on
what backwards compatibility guarantees you're comfortable making:
[tool.poetry.dependencies]my-sdk = ">= 1.0.0, < 2.0.0"
Maybe the plugin could directly modify the version constraints in memory
after Poetry has already parsed them, but I haven't explored how
complicated/feasible that would be.
—
Reply to this email directly, view it on GitHub
<#189 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA66JR5F4EJNM22YGF53H4LZRZ2ENAVCNFSM6AAAAABMSABTPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJUGM3TKMBWGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Unfortunately, at the moment, I don't think you can use this plugin with your setup 😞 |
I'm trying a very similar setup but I'm also using another plugin https://github.com/gerbenoostra/poetry-plugin-mono-repo-deps/ for a monorepo with multiple python projects that depend on each other. It rewrites the version # of path depenencies prior to build. I'm still working through other issues in my setup but I wonder if it might help to use both. |
Actually I think I have similar problem. Unfortunately it's writing out the real version to poetry.lock file . So it would be unrealistic to update it every time. If I don't specify version depenency, it gets stuck on the older one. |
Hi,
I have a mono repo "mono-repo" which contains 2 subfolders "cli" and "sdk".
Both are intrinsically linked (the cli uses the sdk) and therefore I decided to have a common version number (hence the mono-repo, using git tag versions)
However they can be built and deployed independently.
The pyproject.toml for the cli is as follows:
When I try to build it fails due to the first dependency set to 0.0.0 (which does not exist).
Is there a way to have this updated as well as the tool.poetry.version?
The text was updated successfully, but these errors were encountered: