Poetry 1.5: Unresolved Circular Dependency Behavior in Plugin Architectures
19K reputation · 20 Dec 2021, 15:49 UTC
Circular Dependency Handling in Poetry 1.5
Poetry 1.5 enforces deterministic dependency resolution using pyproject.toml as the sole configuration source and a poetry.lock file to pin exact versions. The resolver prefers the lockfile over the TOML to maintain parity across environments.
In plugin-based projects, the core package may depend on a plugin that, in turn, declares a dependency back on the core or on another plugin, creating a circular dependency loop. The current resolver can satisfy straightforward cycles, but the behavior for more complex, multi‑layered circular graphs is not fully documented.
Key constraints include the resolver’s reliance on a single source of truth, the necessity to keep the lockfile deterministic, and the fact that updates to one dependency may cascade to others if constraints allow.
Unresolved questions:
- What is the documented expected behavior of Poetry 1.5 when the resolver encounters a circular dependency involving multiple plugin layers?
- Does Poetry provide a mechanism to break or ignore such loops without relaxing version constraints in pyproject.toml?
- How does the lockfile generation handle these cases, and can a developer force the resolver to accept a specific version set?