Skip to content

refactor: add PEP 484 type annotations across the codebase (#164)#170

Open
Chimankarparag wants to merge 1 commit into
corridor:mainfrom
Chimankarparag:main
Open

refactor: add PEP 484 type annotations across the codebase (#164)#170
Chimankarparag wants to merge 1 commit into
corridor:mainfrom
Chimankarparag:main

Conversation

@Chimankarparag
Copy link
Copy Markdown

Add comprehensive type hints to all core modules using Python 3.9+ compatible syntax (no 'from future import annotations').

  • Annotate factory, operation, schema, version, utils, fetcher, reverter, transaction, expression_reflector modules
  • Annotate table_builder, model_builder, relationship_builder, builder
  • Annotate manager, unit_of_work, and init public API
  • Annotate all plugins (activity, base, null_delete, property_mod_tracker, transaction_changes, transaction_meta)
  • Use TYPE_CHECKING guards to prevent circular imports
  • Fix pre-existing ruff warnings (FBT001, PERF401, A003)

)

Add comprehensive type hints to all core modules using Python 3.9+
compatible syntax (no 'from __future__ import annotations').

- Annotate factory, operation, schema, version, utils, fetcher, reverter,
  transaction, expression_reflector modules
- Annotate table_builder, model_builder, relationship_builder, builder
- Annotate manager, unit_of_work, and __init__ public API
- Annotate all plugins (activity, base, null_delete, property_mod_tracker,
  transaction_changes, transaction_meta)
- Use TYPE_CHECKING guards to prevent circular imports
- Fix pre-existing ruff warnings (FBT001, PERF401, A003)
@Chimankarparag
Copy link
Copy Markdown
Author

Chimankarparag commented May 13, 2026

The Test cases failed due an incompatible annotations in utils.py
Passed tests on python 3.9, DB = sqlite after the change was made.

@Chimankarparag Chimankarparag marked this pull request as ready for review May 13, 2026 13:31
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 25801782794

Warning

No base build found for commit 5fe88b1 on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 95.68%

Details

  • Patch coverage: 34 uncovered changes across 16 files (286 of 320 lines covered, 89.38%).

Uncovered Changes

Top 10 Files by Coverage Impact Changed Covered %
sqlalchemy_history/plugins/activity.py 19 9 47.37%
sqlalchemy_history/plugins/base.py 28 24 85.71%
sqlalchemy_history/plugins/transaction_changes.py 14 11 78.57%
sqlalchemy_history/factory.py 7 5 71.43%
sqlalchemy_history/operation.py 28 26 92.86%
sqlalchemy_history/plugins/property_mod_tracker.py 9 7 77.78%
sqlalchemy_history/utils.py 29 27 93.1%
sqlalchemy_history/init.py 4 3 75.0%
sqlalchemy_history/fetcher.py 20 19 95.0%
sqlalchemy_history/model_builder.py 16 15 93.75%

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 5718
Covered Lines: 5471
Line Coverage: 95.68%
Coverage Strength: 9.51 hits per line

💛 - Coveralls

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