Skip to content

feat: improve mypyc configurations#388

Merged
cofin merged 39 commits intomainfrom
feat/mypyc-compile-boundary
Mar 16, 2026
Merged

feat: improve mypyc configurations#388
cofin merged 39 commits intomainfrom
feat/mypyc-compile-boundary

Conversation

@cofin
Copy link
Member

@cofin cofin commented Mar 15, 2026

Improve mypyc configuration

cofin added 30 commits March 13, 2026 14:53
….py` and update its invocation in tests and Makefile.
patch.object cannot intercept calls in C-extension modules, causing
false assertion failures on mock call counts.
- Fix all exception/context manager signatures: `exc_tb: Any` →
  `"TracebackType | None"` across all adapters, configs, and utilities
- Fix migration abstract method returns: `-> Any` → proper union types
  like `-> "None | Awaitable[None]"` for sync/async duality
- Move cursor wrapper classes from driver.py to _typing.py across all
  16 adapters, consistent with SessionContext placement pattern
- Add cursor TypeAlias exports to adapter _typing.py files following
  the existing connection TypeAlias convention
- Fix handle_database_exceptions Protocol: change pending_exception
  from mutable attribute to @Property for covariance compatibility
- Clean up _typing.py consistency: remove duplicated imports between
  TYPE_CHECKING/else blocks, use `if not TYPE_CHECKING:` pattern
- Fix all mypy errors: remove redundant casts, unused type:ignore
  comments, add proper return type casts
- Fix all pyright errors: resolve 79 → 0 errors including Protocol
  invariance issues with exception handler overrides
- Fix slotscheck: remove stale mypyc .so files that hid __slots__
…e distinct placeholders and add robust rollback handling to the migration tracker.
@cofin cofin changed the title feat: tighten mypyc runtime boundaries and fix compiled regressions feat: improve mypyc configurations Mar 15, 2026
cofin added 9 commits March 15, 2026 22:28
… statement configuration as class variables in adapter configs, and update OracleDB cursor type aliases.
…eading and update `AsyncThreadedBytesIterator` to use it
- Removed `@pytest.mark.asyncio` from various test cases across multiple test files, as they are not required for the current test structure.
- Updated tests in the following files:
  - tests/integration/adapters/mysqlconnector/extensions/events/test_queue_backend.py
  - tests/integration/adapters/mysqlconnector/test_driver_async.py
  - tests/integration/adapters/mysqlconnector/test_exceptions.py
  - tests/integration/adapters/mysqlconnector/test_parameter_styles.py
  - tests/integration/adapters/oracledb/extensions/events/test_queue_backend.py
  - tests/integration/adapters/oracledb/test_driver_async.py
  - tests/integration/adapters/oracledb/test_msgspec_clob.py
  - tests/integration/adapters/oracledb/test_stack.py
  - tests/integration/adapters/psqlpy/extensions/events/test_listen_notify.py
  - tests/integration/adapters/psqlpy/extensions/events/test_queue_backend.py
  - tests/integration/config/test_connection_injection.py
  - tests/integration/extensions/litestar/test_channels_backend.py
  - tests/integration/storage/test_streaming.py
  - tests/integration/test_pool_concurrency.py
  - tests/unit/adapters/test_aiosqlite/test_pool_shutdown.py
  - tests/unit/adapters/test_asyncpg/test_cloud_connectors.py
  - tests/unit/adapters/test_oracledb/test_oracle_adk_store.py
  - tests/unit/adapters/test_pool_logging.py
  - tests/unit/config/test_connection_config_edge_cases.py
  - tests/unit/config/test_connection_config_parameters.py
  - tests/unit/config/test_migration_methods.py
  - tests/unit/driver/test_execute_script.py
  - tests/unit/driver/test_fetch_aliases.py
  - tests/unit/driver/test_stack_base.py
  - tests/unit/extensions/test_events/test_channel.py
  - tests/unit/storage/test_bridge.py
@cofin cofin merged commit dc3857e into main Mar 16, 2026
16 checks passed
@cofin cofin deleted the feat/mypyc-compile-boundary branch March 16, 2026 21:47
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.

1 participant