Skip to content

Conversation

@sergei-maertens
Copy link
Member

@sergei-maertens sergei-maertens commented Oct 21, 2025

  • Require Python 3.12+ (because it has nicer typing syntax)
  • Ignore factory boy & setup-configuration modules, these are quite hopeless to fix at this point
  • Refactored the interfaces for plugins - there is now an actual base class that guarantees some behaviour and obsoletes the protocols
  • Updated test code to also pass type checking in CI

@codecov-commenter
Copy link

codecov-commenter commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 97.59036% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.65%. Comparing base (6966805) to head (8994aaa).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
mozilla_django_oidc_db/backends.py 88.23% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #158      +/-   ##
==========================================
+ Coverage   93.26%   93.65%   +0.38%     
==========================================
  Files          24       24              
  Lines         832      946     +114     
  Branches       67       85      +18     
==========================================
+ Hits          776      886     +110     
- Misses         40       42       +2     
- Partials       16       18       +2     
Flag Coverage Δ
base 82.98% <96.38%> (+1.85%) ⬆️
setupconfig 93.65% <97.59%> (+0.38%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sergei-maertens sergei-maertens force-pushed the chore/type-checking-in-ci branch from a6001eb to e4a173c Compare October 21, 2025 17:43
Python 3.12 has much more pleasant syntax for generic
type variables, and supports the type keyword for
aliases.
Fixing one pyright error at a time...

The protocols are replaced with abstract base classes,
as that is effectively how they are used. This will
also improve the type checking situation for downstream
projects.
@sergei-maertens sergei-maertens force-pushed the chore/type-checking-in-ci branch from e4a173c to 219577e Compare October 21, 2025 17:54
This seems to be a problem in every package with
setup-configuration support, need to do something
about it in the future.
Subclassing a union type is not possible, which
highlighted that the registry is generic as long as
the base plugin API is implemented.
@sergei-maertens sergei-maertens marked this pull request as ready for review October 21, 2025 20:03
Copy link
Contributor

@SilviaAmAm SilviaAmAm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I had initially implemented it with the abstract classes, but then I had struggled with it in the backend get_or_create_user because it felt clunky.

And now it looks so natural 😅

@sergei-maertens sergei-maertens merged commit 6ced53f into master Oct 23, 2025
11 checks passed
@sergei-maertens sergei-maertens deleted the chore/type-checking-in-ci branch October 23, 2025 13:14
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.

4 participants