Skip to content

fix: Use stdlib override when possible - #561

Open
edrogers wants to merge 3 commits into
googleapis:mainfrom
edrogers:use-stdlib-override-when-possible
Open

fix: Use stdlib override when possible#561
edrogers wants to merge 3 commits into
googleapis:mainfrom
edrogers:use-stdlib-override-when-possible

Conversation

@edrogers

Copy link
Copy Markdown

Fixes#560

This PR uses typing.override in favor of the overrides dependency when possible. As of Python 3.12, the standard library offers typing.override to perform a static check on overridden methods.

Motivation

Currently, overrides is incompatible with Python 3.14. As a result, any package that attempts to import overrides using Python 3.14+ will raise an AttributeError. An issue has been raised and a pull request has been submitted to the GitHub repo for the overrides project. But the maintainer has been unresponsive.

To ensure readiness for Python 3.14, this package (and any other package directly depending on overrides) should consider using typing.override instead

@edrogers
edrogers requested review from a teamOctober 2, 2025 22:36
@google-cla

google-claBot commented Oct 2, 2025

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-labelproduct-auto-labelBot added size: m Pull request size is medium. api: pubsublite Issues related to the googleapis/python-pubsublite API. labels Oct 2, 2025
Replace the abandoned 'overrides' package with stdlib typing.override for Python 3.12+. This fixes AttributeError that occurs in Python 3.14 when importing from overrides. The overrides dependency is now only installed for Python < 3.12 via environment marker.
@edrogers
edrogersforce-pushed the use-stdlib-override-when-possible branch from 8570abf to 0e94541CompareOctober 3, 2025 13:41
@partheaparthea changed the title Use stdlib override when possiblefix: Use stdlib override when possibleNov 11, 2025
@partheaparthea added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Nov 11, 2025
@gcf-owl-botgcf-owl-botBot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 11, 2025
@yoshi-kokoroyoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Nov 11, 2025
@partheaparthea assigned acocuzzo and unassigned amfisher-404Nov 12, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsubliteIssues related to the googleapis/python-pubsublite API.size: mPull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dependency on overrides causes crash for Python 3.14

5 participants

@edrogers@parthea@yoshi-kokoro@acocuzzo@amfisher-404