Skip to content

Conversation

@simonw
Copy link
Owner

@simonw simonw commented Dec 15, 2025

  • Improve mypy configuration with appropriate strictness settings
  • Add comprehensive type hints to public API functions:
    • hookspecs.py: Type register_commands and prepare_connection hooks
    • plugins.py: Type get_plugins function and PluginManager
    • recipes.py: Type parsedate, parsedatetime, jsonsplit functions
    • utils.py: Type all public utility functions including rows_from_file,
      TypeTracker, ValueTracker, chunks, hash_record, flatten, etc.
    • db.py: Type Database, Queryable, Table, and View class methods
      including constructor, execute, query, table operations, etc.
  • Exclude cli.py from strict checking (internal implementation detail)
  • All public API modules now pass mypy type checking

📚 Documentation preview 📚: https://sqlite-utils--695.org.readthedocs.build/en/695/

- Improve mypy configuration with appropriate strictness settings
- Add comprehensive type hints to public API functions:
  - hookspecs.py: Type register_commands and prepare_connection hooks
  - plugins.py: Type get_plugins function and PluginManager
  - recipes.py: Type parsedate, parsedatetime, jsonsplit functions
  - utils.py: Type all public utility functions including rows_from_file,
    TypeTracker, ValueTracker, chunks, hash_record, flatten, etc.
  - db.py: Type Database, Queryable, Table, and View class methods
    including constructor, execute, query, table operations, etc.
- Exclude cli.py from strict checking (internal implementation detail)
- All public API modules now pass mypy type checking
- Use TYPE_CHECKING guard in recipes.py to prevent typing imports from
  appearing in module namespace (fixes test_recipes_are_documented)
- Update test_convert_help to check for function names with type hints
  in a more flexible way
@simonw
Copy link
Owner Author

simonw commented Dec 17, 2025

I should have landed this before:

Gonna have to redo this one now.

@simonw simonw closed this Dec 17, 2025
@simonw simonw mentioned this pull request Dec 17, 2025
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.

3 participants