Skip to content

Commit c923da9

Browse files
committed
Bump minimal Python version to 3.10.
1 parent 8efa393 commit c923da9

7 files changed

Lines changed: 87 additions & 945 deletions

File tree

.github/workflows/python-app.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
include:
22-
- python-version: "3.8"
23-
os: ubuntu-latest
24-
- python-version: "3.9"
25-
os: ubuntu-latest
2622
- python-version: "3.10"
2723
os: ubuntu-latest
2824
- python-version: "3.11"

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides guidance to Agents when working with code in this repository.
44

55
## Project Overview
66

7-
sqlparse is a non-validating SQL parser for Python that provides support for parsing, splitting, and formatting SQL statements. It's compatible with Python 3.8+ and supports multiple SQL dialects (Oracle, MySQL, PostgreSQL/PL/pgSQL, HQL, MS Access, Snowflake, BigQuery).
7+
sqlparse is a non-validating SQL parser for Python that provides support for parsing, splitting, and formatting SQL statements. It's compatible with Python 3.10+ and supports multiple SQL dialects (Oracle, MySQL, PostgreSQL/PL/pgSQL, HQL, MS Access, Snowflake, BigQuery).
88

99
## Development Commands
1010

CHANGELOG

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
Development Version
22
-------------------
33

4+
Notable Changes
5+
6+
* Drop support for Python 3.8 and 3.9. Python 3.10+ is now required.
7+
* Migrate project dependencies and environment management from `pixi` to `uv`.
8+
* Replace `flake8` with `ruff` for code checking and linting.
9+
10+
Enhancements
11+
12+
* Modernize type annotations in top-level API functions using PEP 585 and PEP 604 syntax.
13+
414
Bug Fixes
515

616
* Fix statement splitting (issue845).
17+
* Fix a late-binding closure bug in `TokenList.token_not_matching`.
718

819

920
Release 0.5.5 (Dec 19, 2025)

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ help:
1010
@sed -n '/^[a-zA-Z0-9_.]*:/s/:.*//p' <Makefile | sort
1111

1212
test:
13-
uv run --group dev --python 3.8 pytest tests/
14-
uv run --group dev --python 3.9 pytest tests/
1513
uv run --group dev --python 3.10 pytest tests/
1614
uv run --group dev --python 3.11 pytest tests/
1715
uv run --group dev --python 3.12 pytest tests/

pyproject.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ classifiers = [
1616
"Programming Language :: Python",
1717
"Programming Language :: Python :: 3",
1818
"Programming Language :: Python :: 3 :: Only",
19-
"Programming Language :: Python :: 3.8",
20-
"Programming Language :: Python :: 3.9",
2119
"Programming Language :: Python :: 3.10",
2220
"Programming Language :: Python :: 3.11",
2321
"Programming Language :: Python :: 3.12",
@@ -27,8 +25,8 @@ classifiers = [
2725
"Programming Language :: Python :: Implementation :: PyPy",
2826
"Topic :: Database",
2927
"Topic :: Software Development",
30-
]
31-
requires-python = ">=3.8"
28+
]
29+
requires-python = ">=3.10"
3230

3331
[project.urls]
3432
Home = "https://github.com/andialbrecht/sqlparse"
@@ -79,7 +77,7 @@ dev = [
7977
]
8078

8179
[tool.ruff]
82-
target-version = "py38"
80+
target-version = "py310"
8381
exclude = [
8482
"dist",
8583
"docs",

sqlparse/__init__.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"""Parse SQL statements."""
99

1010
# Setup namespace
11-
from typing import IO, Any, Generator, List, Optional, Tuple, Union
11+
from collections.abc import Generator
12+
from typing import IO, Any
1213

1314
from sqlparse import cli, engine, filters, formatter, sql, tokens
1415

@@ -17,8 +18,8 @@
1718

1819

1920
def parse(
20-
sql: str, encoding: Optional[str] = None
21-
) -> Tuple[sql.Statement, ...]:
21+
sql: str, encoding: str | None = None
22+
) -> tuple[sql.Statement, ...]:
2223
"""Parse sql and return a list of statements.
2324
2425
:param sql: A string containing one or more SQL statements.
@@ -29,7 +30,7 @@ def parse(
2930

3031

3132
def parsestream(
32-
stream: Union[str, IO[str]], encoding: Optional[str] = None
33+
stream: str | IO[str], encoding: str | None = None
3334
) -> Generator[sql.Statement, None, None]:
3435
"""Parses sql statements from file-like object.
3536
@@ -42,7 +43,7 @@ def parsestream(
4243
return stack.run(stream, encoding)
4344

4445

45-
def format(sql: str, encoding: Optional[str] = None, **options: Any) -> str:
46+
def format(sql: str, encoding: str | None = None, **options: Any) -> str:
4647
"""Format *sql* according to *options*.
4748
4849
Available options are documented in :ref:`formatting`.
@@ -60,8 +61,8 @@ def format(sql: str, encoding: Optional[str] = None, **options: Any) -> str:
6061

6162

6263
def split(
63-
sql: str, encoding: Optional[str] = None, strip_semicolon: bool = False
64-
) -> List[str]:
64+
sql: str, encoding: str | None = None, strip_semicolon: bool = False
65+
) -> list[str]:
6566
"""Split *sql* into single statements.
6667
6768
:param sql: A string containing one or more SQL statements.

0 commit comments

Comments
 (0)