-
Notifications
You must be signed in to change notification settings - Fork 69
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
in_toto_attestation/v1: fix type hints #301
Conversation
Signed-off-by: William Woodruff <[email protected]>
def copy_from_pb(proto: type[rdpb.ResourceDescriptor]) -> 'ResourceDescriptor': | ||
def copy_from_pb(proto: rdpb.ResourceDescriptor) -> "ResourceDescriptor": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB: I thought a bit about this, and I think this hint was wrong to begin with: type[T]
is used an annotation for class objects themselves, which isn't what this API takes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
Aside: IMHO we should standardise on black
code style & lint Python changes with black
in the CI.
Sounds good, I can do this 🙂 (Unless there's a very strong preference, I like |
would we set it up in CI to ignore the proto generated files? |
That would work, or you can have the CI format all files unconditionally -- as long as the formatting is part of the codegen step and is deterministic/has a fixpoint, I don't think it matters much (and has the added benefit of making it a little easier to read the generated code). |
makes sense! That's currently invoked in CI here: https://github.com/in-toto/attestation/blob/main/.github/workflows/make-protos.yml. Adding the formatting to the Makefile for the python target should be sufficient. |
Does someone have merge permissions here? I'd like to land this in a release to unblock the work on DSSE support in |
Done. I'm never sure what the right etiquette here is. |
Fixes #300.
My editor made some formatting changes as well, based on the
black
rules -- let me know if you'd prefer to not have these, and I'll limit this PR to just the type fix.