Skip to content

Commit 83c5052

Browse files
committed
Add type hints to public APIs and configure mypy
- 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
1 parent fd5b09f commit 83c5052

File tree

6 files changed

+226
-126
lines changed

6 files changed

+226
-126
lines changed

mypy.ini

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
11
[mypy]
2+
python_version = 3.10
3+
warn_return_any = False
4+
warn_unused_configs = True
5+
warn_redundant_casts = False
6+
warn_unused_ignores = False
7+
check_untyped_defs = True
8+
disallow_untyped_defs = False
9+
disallow_incomplete_defs = False
10+
no_implicit_optional = True
11+
strict_equality = True
212

3-
[mypy-pysqlite3,sqlean,sqlite_dump]
13+
[mypy-sqlite_utils.cli]
14+
ignore_errors = True
15+
16+
[mypy-pysqlite3.*]
17+
ignore_missing_imports = True
18+
19+
[mypy-sqlean.*]
20+
ignore_missing_imports = True
21+
22+
[mypy-sqlite_dump.*]
23+
ignore_missing_imports = True
24+
25+
[mypy-sqlite_fts4.*]
26+
ignore_missing_imports = True
27+
28+
[mypy-pandas.*]
29+
ignore_missing_imports = True
30+
31+
[mypy-numpy.*]
432
ignore_missing_imports = True

0 commit comments

Comments
 (0)