Repository navigation
refactor(build): upgrade Python baseline to 3.11+ and add Python 3.15 support - #835
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…back on Python 3.15
Signed-off-by: Cody Fincher <204685+cofin@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andcibuildwheelMyPyC wheel builds (cp311-*throughcp315-*), removes thetomlidependency andsys.version_info < (3, 11)fallbacks in favor of stdlibtomllib, and modernizes the codebase for Python 3.11 (enum.StrEnum,datetime.UTC, builtinTimeoutError, nativedatetime.fromisoformat, and stdlibtypingimports).Key Changes
1. Packaging, Tooling Baseline &
tomllibMigration (pyproject.toml,Makefile,uv.lock)requires-python = ">=3.11, <4.0", replaced theProgramming Language :: Python :: 3.10classifier withProgramming Language :: Python :: 3.15, removedtomli>=2.0.1; python_version < "3.11"from[project].dependenciesand[dependency-groups].lint, and pinneduv python pin 3.11inMakefile.[tool.mypy](python_version = "3.11"),[tool.pyright](pythonVersion = "3.11"), and[tool.ruff](target-version = "py311", updated the__future__.annotationsban message, and added"ASYNC109"to[tool.ruff.lint].ignorefor intentionaltimeoutparameters on async driver/queue APIs).tomllib: Replaced conditionalsys.version_info >= (3, 11)/tomlifallback imports with unconditionalimport tomllibinsqlspec/utils/config_tools.py,sqlspec/data_dictionary/_loader.py,tools/scripts/mypyc_inventory.py, andtests/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, andJSONStorageTypeinsqlspec/adapters/oracledb/data_dictionary.py) toenum.StrEnumwhile preservingslotscheckcompliance across all 527 modules.datetime.UTC(UP017) & Nativefromisoformat(FURB162): Replaceddatetime.timezone.utcwithdatetime.UTCacrosssqlspec/andtests/, and simplified_BeforeAfterFilterProvider._parse_datetimeinsqlspec/extensions/fastapi/providers.pyto use Python 3.11's nativeZ-suffix support indatetime.datetime.fromisoformat(value).TimeoutError(UP041): Replacedasyncio.TimeoutErroraliases with builtinTimeoutErroracross adapter pools, drivers, and concurrency tests.typingImports (UP035) & Type Checker Alignment: MigratedSelf,NotRequired, andRequiredimports fromtyping_extensionstotypingwhile preservingfrom typing_extensions import TypeVarinsqlspec/typing.pyfor PEP 696default=...support, and resolved Python 3.11mypyandpyrightdiagnostics insqlspec/typing.py,sqlspec/protocols.py,sqlspec/driver/_common.py, and unit tests.3. CI/CD Workflows, MyPyC Wheel Matrix & Documentation (
.github/workflows/,docs/).github/workflows/ci.yml): Updatedtest-unitandtest-integrationPython matrices to["3.11", "3.12", "3.13", "3.14", "3.15"]withcontinue-on-error: ${{ matrix.python-version == '3.15' }}andfail-fast: falseso Python 3.15 runs without blocking CI or cancelling3.11–3.14runs while upstream binary wheels (such asmssql-python) catch up..github/workflows/test-build.yml,.github/workflows/publish.yml): UpdatedCIBW_BUILDto"cp311-* cp312-* cp313-* cp314-* cp315-*", keptREQUIRED_CHECKSintest-build.ymlgated onqualityandtest-unit (3.11)–test-unit (3.14), retained"3.14"inpublish.ymltest-wheels(["3.11", "3.13", "3.14", "3.15"]), and enabledcontinue-on-error: ${{ matrix.python-version == '3.15' }}on wheel build and smoke-test jobs.docs/): Updateddocs/releases.rstanddocs/usage/frameworks/litestar/installation.rstto reflect the Python 3.11+ requirement and Python 3.11–3.14 (with experimental 3.15) MyPyC wheel matrix.Verification
target-version = "py311"):uv run ruff check sqlspec/ tests/ tools/ docs/(0 errors)python_version = "3.11"):uv run mypy(Success: no issues found in 1509 source files)pythonVersion = "3.11"):uv run pyright(0 errors, 0 warnings, 0 informations)uv run slotscheck sqlspec/(All OK! Scanned 527 module(s), 1208 class(es))uv run python tools/scripts/mypyc_inventory.py --check(exit 0)uv run zizmor --strict-collection .github/workflows(No findings to report)uv run sphinx-build -M html docs docs/_build/ -j auto -W --keep-going(build succeeded,0 warnings)