Skip to content

build(NoTicket): update dependencies for Python 3.10 - #538

Merged
lorenzhs merged 2 commits into
mainfrom
lorenz/python-310-dependency-updates
Oct 7, 2026
Merged

lorenzhs merged 2 commits into
mainfrom
lorenz/python-310-dependency-updates

Conversation

@lorenzhs

@lorenzhs lorenzhs commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Now that the SDK requires Python 3.10, update dependencies and development tools to their latest compatible releases.

Update sqlparse to 0.6.0, which includes parser denial-of-service fixes. Adapt our CASE workaround to the new upstream block-stack splitter and add regressions for escaped semicolons and nested CASE expressions. The workaround is still needed pending sqlparse PR #839.

Also update AnyIO, Trio, mypy, pyfakefs, pytest and its plugins, pre-commit, Sphinx's Python 3.10-compatible floor, and formatting/lint hooks. Remove two ineffective fixture marks that pytest 9 rejects; the usage-tracker test retains its xdist grouping. Include the formatting changes required by the new Black release.

Validation on Python 3.10:

  • Unit suite: 780 passed, 1 skipped.
  • Usage-tracker integration tests with 6 xdist workers: 8 passed.
  • All 219 integration tests collect.
  • All pre-commit checks pass, including mypy 2.4.
  • Documentation build succeeds with 29 existing warnings.
  • Dependency audit of the 90 resolved runtime/dev/docs packages reports no known vulnerabilities.

Live database integration tests were not rerun locally.


Note

Medium Risk
Upgrading sqlparse and rewriting statement-splitting logic can change how multi-statement queries are parsed; dependency bumps (mypy 2, pytest 9) affect CI only but runtime parsing is user-facing.

Overview
Bumps runtime and dev dependencies for the Python 3.10+ baseline: sqlparse 0.6.0 (DoS fixes), AnyIO/Trio, mypy 2.x, pytest 9 and plugins, pre-commit/Sphinx floors, and refreshed pre-commit hooks (Black 26, isort 9, flake8 7.4, etc.). setup.cfg pins the new versions; the example notebook picks up Black-driven formatting only.

The main product change is adapting SQL statement splitting after the sqlparse upgrade: the old large _change_splitlevel monkeypatch is replaced by a thin wrapper that delegates to sqlparse’s splitter and only adds CASE tracking outside BEGIN blocks (still pending upstream PR #839). New unit tests cover CASE expressions with escaped semicolons in literals and nested CASE when splitting multi-statement SQL.

Test harness cleanup drops invalid @mark.xdist_group on module fixtures (pytest 9); usage-tracker parametrized tests keep their xdist group. A trivial # type: ignore spacing fix in base_cursor.py.

Reviewed by Cursor Bugbot for commit 845562c. Bugbot is set up for automated code reviews on this repo. Configure here.

Adapt the CASE tracking workaround to the upstream block-stack splitter and cover escaped semicolons and nested CASE expressions.

Upstream fix: andialbrecht/sqlparse#839
Update runtime, test, documentation, and formatting dependencies. Remove redundant marks on fixtures rejected by pytest 9 while retaining the usage-tracker test group.
@lorenzhs
lorenzhs marked this pull request as ready for review October 7, 2026 11:41
@lorenzhs
lorenzhs requested a review from a team as a code owner October 7, 2026 11:41
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

@lorenzhs

lorenzhs commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@lorenzhs
lorenzhs merged commit b5d10b1 into main Oct 7, 2026
18 checks passed
@lorenzhs
lorenzhs deleted the lorenz/python-310-dependency-updates branch October 7, 2026 11:56
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