Skip to content

fix(models): break circular import with Rekor clients#1667

Open
MatteoFari wants to merge 1 commit intosigstore:mainfrom
MatteoFari:bugfix/rekor-clients-import
Open

fix(models): break circular import with Rekor clients#1667
MatteoFari wants to merge 1 commit intosigstore:mainfrom
MatteoFari:bugfix/rekor-clients-import

Conversation

@MatteoFari
Copy link

Summary

fixes: #1536
This PR fixes the circular import that required lazy imports in sigstore.models after moving additional trust/config types into models.py.

Release Note

Fixed a circular import between sigstore.models and Rekor client modules, removing the need for lazy imports when constructing transparency log clients.

Documentation

Signed-off-by: Matteo Fari <matteofari06@gmail.com>
@MatteoFari
Copy link
Author

MatteoFari commented Feb 3, 2026

@jku sorry to bother, do you think it fixes the circular import or is there an issue?

@jku
Copy link
Member

jku commented Feb 4, 2026

sorry, it's been a little busy.

The PR moves the lazy imports to a different place -- maybe a slightly more appropriate one but it's still a lazy import to avoid the cycle, right?

It's quite possible that there is no clean way to avoid lazy imports here but I'm not sure this is an improvement.

@MatteoFari
Copy link
Author

Yeah, you're right it's just a lazy import in another place, even tho it's a little bit more clean.

The goal was to keep sigstore.models clean and break the cycle by lazily importing TransparencyLogEntry inside the Rekor client methods where it’s actually used.

So I think that if we want zero lazy imports we should split TransparencyLogEntry into a separate module and re‑export it from models, which is a bigger refactor tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix lazy import in models.py

2 participants