Skip to content

Add type annotations to SIP2 client and provider#3091

Merged
jonathangreen merged 1 commit intomainfrom
chore/sip2-annotations
Mar 3, 2026
Merged

Add type annotations to SIP2 client and provider#3091
jonathangreen merged 1 commit intomainfrom
chore/sip2-annotations

Conversation

@jonathangreen
Copy link
Member

@jonathangreen jonathangreen commented Mar 2, 2026

Description

Add comprehensive type annotations to the SIP2 authentication client and provider modules, and refactor the SIP2 field descriptor system to use idiomatic Python patterns.

Motivation and Context

The SIP2 modules were excluded from mypy type checking. This change adds full type coverage, enabling static analysis to catch bugs in this critical authentication path. The field descriptor refactoring replaces a non-standard _add() pattern with standard Python descriptors, improving readability and IDE support.

How Has This Been Tested?

  • Existing SIP2 client and provider tests updated to reflect the new username: str contract.
  • Removed tests for None username cases that are no longer reachable.

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@jonathangreen jonathangreen requested a review from a team March 2, 2026 18:10
@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 94.19355% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.18%. Comparing base (cb46a97) to head (cd4f7af).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...ace/manager/integration/patron_auth/sip2/client.py 96.24% 4 Missing and 1 partial ⚠️
...e/manager/integration/patron_auth/sip2/provider.py 80.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3091      +/-   ##
==========================================
- Coverage   93.20%   93.18%   -0.02%     
==========================================
  Files         491      491              
  Lines       45248    45256       +8     
  Branches     6222     6224       +2     
==========================================
  Hits        42172    42172              
- Misses       1992     1997       +5     
- Partials     1084     1087       +3     

☔ 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.

Copy link
Contributor

@dbernstein dbernstein left a comment

Choose a reason for hiding this comment

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

Looking good.

@jonathangreen jonathangreen merged commit 05dcff4 into main Mar 3, 2026
19 checks passed
@jonathangreen jonathangreen deleted the chore/sip2-annotations branch March 3, 2026 20:31
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