Skip to content

*CodecContext: fix stubtest errors - #2448

Merged
WyattBlue merged 1 commit into
PyAV-Org:masterfrom
jorenham:typing/context.CodecContext/add-missing-methods
Oct 21, 2026
Merged

WyattBlue merged 1 commit into
PyAV-Org:masterfrom
jorenham:typing/context.CodecContext/add-missing-methods

Conversation

@jorenham

Copy link
Copy Markdown
Contributor

As mentioned in #2447, there are currently quite a lot of stubtest errors in av, i.e. mismatches between the runtime API and the stubs, 267 to be exact.
This resolves 10 of those errors, bringing down the total to 267.

For completeness' sake, here are the exact stubtest errors (reported with the --concise flag, because, well, it's more concise):

av.codec.context.CodecContext is a disjoint base at runtime, but isn't marked with @disjoint_base in the stub
av.codec.context.CodecContext.decode is not present in stub
av.codec.context.CodecContext.encode is not present in stub
av.codec.context.CodecContext.encode_lazy is not present in stub

av.audio.codeccontext.AudioCodecContext cannot be subclassed at runtime, but isn't marked with @final in the stub
av.audio.codeccontext.AudioCodecContext is a disjoint base at runtime, but isn't marked with @disjoint_base in the stub

av.subtitles.codeccontext.SubtitleCodecContext cannot be subclassed at runtime, but isn't marked with @final in the stub
av.subtitles.codeccontext.SubtitleCodecContext is a disjoint base at runtime, but isn't marked with @disjoint_base in the stub

av.video.codeccontext.VideoCodecContext cannot be subclassed at runtime, but isn't marked with @final in the stub
av.video.codeccontext.VideoCodecContext is a disjoint base at runtime, but isn't marked with @disjoint_base in the stub

Those duplicate @final and @disjoint_base errors are a bit weird, but both disappear when @final is applied (which kinda makes sense, since @final is essentially a stricter variant of @disjoint_base, but still, IMO stubtest should've only complained about @final here).

@WyattBlue

Copy link
Copy Markdown
Member

This is a good enough trade-off, but we should make CodecContext generic over the frame type eventually.

@WyattBlue
WyattBlue merged commit f5c2bd4 into PyAV-Org:master Oct 21, 2026
8 of 9 checks passed
@jorenham
jorenham deleted the typing/context.CodecContext/add-missing-methods branch October 21, 2026 20:13
@jorenham

Copy link
Copy Markdown
Contributor Author

Thanks for the quick review.

we should make CodecContext generic over the frame type eventually.

Yea good idea

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.

2 participants