Skip to content

refactor(build): upgrade Python baseline to 3.11+ and add Python 3.15 support - #835

Merged
cofin merged 9 commits into
mainfrom
feat/python-315-drop-310
Oct 11, 2026
Merged

cofin merged 9 commits into
mainfrom
feat/python-315-drop-310

Conversation

@cofin

@cofin cofin commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Upgrades the minimum supported Python version from 3.10 to 3.11 (requires-python = ">=3.11, <4.0"), adds experimental Python 3.15 support (continue-on-error) across PyPI classifiers, GitHub Actions CI test matrices, and cibuildwheel MyPyC wheel builds (cp311-* through cp315-*), removes the tomli dependency and sys.version_info < (3, 11) fallbacks in favor of stdlib tomllib, and modernizes the codebase for Python 3.11 (enum.StrEnum, datetime.UTC, builtin TimeoutError, native datetime.fromisoformat, and stdlib typing imports).

Key Changes

1. Packaging, Tooling Baseline & tomllib Migration (pyproject.toml, Makefile, uv.lock)

  • Python Version Metadata: Updated requires-python = ">=3.11, <4.0", replaced the Programming Language :: Python :: 3.10 classifier with Programming Language :: Python :: 3.15, removed tomli>=2.0.1; python_version < "3.11" from [project].dependencies and [dependency-groups].lint, and pinned uv python pin 3.11 in Makefile.
  • Static Analysis Targets: Updated [tool.mypy] (python_version = "3.11"), [tool.pyright] (pythonVersion = "3.11"), and [tool.ruff] (target-version = "py311", updated the __future__.annotations ban message, and added "ASYNC109" to [tool.ruff.lint].ignore for intentional timeout parameters on async driver/queue APIs).
  • Stdlib tomllib: Replaced conditional sys.version_info >= (3, 11) / tomli fallback imports with unconditional import tomllib in sqlspec/utils/config_tools.py, sqlspec/data_dictionary/_loader.py, tools/scripts/mypyc_inventory.py, and tests/unit/config/test_discovery.py.

2. Python 3.11+ Codebase Modernization (sqlspec/, tests/)

  • enum.StrEnum (UP042): Migrated all 10 (str, Enum) classes (ExplainFormat, ParameterStyle, DependencyEdgeKind, DependencyStrength, DependencyDirection, MetadataSupport, MetadataFidelity, MetadataRisk, MetadataSource, and JSONStorageType in sqlspec/adapters/oracledb/data_dictionary.py) to enum.StrEnum while preserving slotscheck compliance across all 527 modules.
  • datetime.UTC (UP017) & Native fromisoformat (FURB162): Replaced datetime.timezone.utc with datetime.UTC across sqlspec/ and tests/, and simplified _BeforeAfterFilterProvider._parse_datetime in sqlspec/extensions/fastapi/providers.py to use Python 3.11's native Z-suffix support in datetime.datetime.fromisoformat(value).
  • Builtin TimeoutError (UP041): Replaced asyncio.TimeoutError aliases with builtin TimeoutError across adapter pools, drivers, and concurrency tests.
  • Stdlib typing Imports (UP035) & Type Checker Alignment: Migrated Self, NotRequired, and Required imports from typing_extensions to typing while preserving from typing_extensions import TypeVar in sqlspec/typing.py for PEP 696 default=... support, and resolved Python 3.11 mypy and pyright diagnostics in sqlspec/typing.py, sqlspec/protocols.py, sqlspec/driver/_common.py, and unit tests.

3. CI/CD Workflows, MyPyC Wheel Matrix & Documentation (.github/workflows/, docs/)

  • CI Test Matrix (.github/workflows/ci.yml): Updated test-unit and test-integration Python matrices to ["3.11", "3.12", "3.13", "3.14", "3.15"] with continue-on-error: ${{ matrix.python-version == '3.15' }} and fail-fast: false so Python 3.15 runs without blocking CI or cancelling 3.11–3.14 runs while upstream binary wheels (such as mssql-python) catch up.
  • MyPyC Wheel Build & Release Workflows (.github/workflows/test-build.yml, .github/workflows/publish.yml): Updated CIBW_BUILD to "cp311-* cp312-* cp313-* cp314-* cp315-*", kept REQUIRED_CHECKS in test-build.yml gated on quality and test-unit (3.11)–test-unit (3.14), retained "3.14" in publish.yml test-wheels (["3.11", "3.13", "3.14", "3.15"]), and enabled continue-on-error: ${{ matrix.python-version == '3.15' }} on wheel build and smoke-test jobs.
  • Documentation (docs/): Updated docs/releases.rst and docs/usage/frameworks/litestar/installation.rst to reflect the Python 3.11+ requirement and Python 3.11–3.14 (with experimental 3.15) MyPyC wheel matrix.

Verification

  • Ruff (target-version = "py311"): uv run ruff check sqlspec/ tests/ tools/ docs/ (0 errors)
  • MyPy (python_version = "3.11"): uv run mypy (Success: no issues found in 1509 source files)
  • Pyright (pythonVersion = "3.11"): uv run pyright (0 errors, 0 warnings, 0 informations)
  • Slotscheck: uv run slotscheck sqlspec/ (All OK! Scanned 527 module(s), 1208 class(es))
  • MyPyC Inventory: uv run python tools/scripts/mypyc_inventory.py --check (exit 0)
  • GitHub Actions Security Audit: uv run zizmor --strict-collection .github/workflows (No findings to report)
  • Sphinx Documentation Build: uv run sphinx-build -M html docs docs/_build/ -j auto -W --keep-going (build succeeded, 0 warnings)

@codecov-commenter

codecov-commenter commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.84615% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.71%. Comparing base (832402a) to head (8d458a5).

Files with missing lines Patch % Lines
sqlspec/adapters/aiosqlite/adk/store.py 66.66% 4 Missing ⚠️
sqlspec/adapters/arrow_odbc/adk/store.py 63.63% 4 Missing ⚠️
sqlspec/adapters/sqlite/adk/store.py 66.66% 4 Missing ⚠️
sqlspec/adapters/aiosqlite/pool.py 25.00% 3 Missing ⚠️
sqlspec/adapters/duckdb/adk/store.py 66.66% 3 Missing ⚠️
sqlspec/adapters/adbc/adk/store.py 60.00% 2 Missing ⚠️
sqlspec/adapters/bigquery/litestar/store.py 60.00% 2 Missing ⚠️
...lspec/adapters/cockroach_psycopg/litestar/store.py 50.00% 2 Missing ⚠️
sqlspec/adapters/spanner/litestar/store.py 66.66% 2 Missing ⚠️
sqlspec/adapters/adbc/litestar/store.py 66.66% 1 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #835      +/-   ##
==========================================
- Coverage   81.76%   81.71%   -0.05%     
==========================================
  Files         522      522              
  Lines       80462    80378      -84     
  Branches    11628    11626       -2     
==========================================
- Hits        65786    65684     -102     
- Misses      10919    10929      +10     
- Partials     3757     3765       +8     
Flag Coverage Δ
integration 62.36% <78.15%> (-0.07%) ⬇️
py3.10 ?
py3.11 80.08% <81.84%> (-0.02%) ⬇️
py3.12 80.09% <81.84%> (-0.02%) ⬇️
py3.13 80.09% <81.84%> (+7.91%) ⬆️
py3.14 81.10% <89.84%> (-0.02%) ⬇️
unit 72.68% <74.15%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sqlspec/_typing.py 79.71% <100.00%> (ø)
sqlspec/adapters/adbc/config.py 93.43% <100.00%> (-0.04%) ⬇️
sqlspec/adapters/adbc/driver.py 80.49% <100.00%> (-0.06%) ⬇️
sqlspec/adapters/aiomysql/adk/store.py 71.75% <100.00%> (-0.07%) ⬇️
sqlspec/adapters/aiomysql/config.py 91.96% <100.00%> (-0.04%) ⬇️
sqlspec/adapters/aiomysql/litestar/store.py 88.54% <100.00%> (-0.09%) ⬇️
sqlspec/adapters/aiosqlite/config.py 96.77% <100.00%> (-0.02%) ⬇️
sqlspec/adapters/aiosqlite/events/store.py 100.00% <100.00%> (ø)
sqlspec/adapters/aiosqlite/litestar/store.py 91.22% <100.00%> (-0.08%) ⬇️
sqlspec/adapters/arrow_odbc/config.py 88.60% <100.00%> (-0.08%) ⬇️
... and 131 more

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

cofin and others added 2 commits October 9, 2026 17:41
Signed-off-by: Cody Fincher <204685+cofin@users.noreply.github.com>
@cofin
cofin merged commit 4a57235 into main Oct 11, 2026
27 checks passed
@cofin
cofin deleted the feat/python-315-drop-310 branch October 11, 2026 14:46
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