Skip to content
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

deps: bump protobuf-specs #1276

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

deps: bump protobuf-specs #1276

wants to merge 4 commits into from

Conversation

woodruffw
Copy link
Member

Very WIP. This includes underlying changes to the proto models themselves, so I need to go through various internal usages and correct them.

On the plus side, this makes our typechecking of each proto model's internals much more correct.

Signed-off-by: William Woodruff <william@trailofbits.com>
@woodruffw woodruffw marked this pull request as draft January 10, 2025 22:05
Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
@woodruffw
Copy link
Member Author

Switching to betterproto's Pydantic models produces generally better-typed results, but it looks like enums are strictly worse:

sigstore/_internal/trust.py:96: error: Argument 1 to <set> has incompatible type "int"; expected "PublicKeyDetails"  [arg-type]
sigstore/_internal/trust.py:97: error: Argument 2 to <set> has incompatible type "int"; expected "PublicKeyDetails"  [arg-type]
sigstore/_internal/trust.py:98: error: Argument 3 to <set> has incompatible type "int"; expected "PublicKeyDetails"  [arg-type]
sigstore/_internal/trust.py:99: error: Argument 4 to <set> has incompatible type "int"; expected "PublicKeyDetails"  [arg-type]
sigstore/_internal/trust.py:103: error: Dict entry 0 has incompatible type "int": "SHA256"; expected "PublicKeyDetails": "HashAlgorithm"  [dict-item]
sigstore/_internal/trust.py:104: error: Dict entry 1 has incompatible type "int": "SHA384"; expected "PublicKeyDetails": "HashAlgorithm"  [dict-item]
sigstore/_internal/trust.py:105: error: Dict entry 2 has incompatible type "int": "SHA512"; expected "PublicKeyDetails": "HashAlgorithm"  [dict-item]
sigstore/models.py:670: error: Incompatible types in assignment (expression has type "dict[str, MessageSignature]", variable has type "MessageSignature | Envelope")  [assignment]
sigstore/models.py:672: error: Incompatible types in assignment (expression has type "dict[str, sigstore_protobuf_specs.io.intoto.Envelope]", variable has type "MessageSignature | sigstore.dsse.Envelope")  [assignment]
sigstore/models.py:674: error: Argument after ** must be a mapping, not "MessageSignature | Envelope"  [arg-type]
Found 10 errors in 2 files (checked [28](https://github.com/sigstore/sigstore-python/actions/runs/12772251322/job/35601345407?pr=1276#step:5:29) source files)
make: *** [Makefile:66: lint] Error 1

I'll look into whether this can be fixed upstream.

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.

1 participant