From 82aa7d786deaf77a8342c912994fc90a4bba5d3a Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Wed, 15 Jan 2025 23:03:49 +0100 Subject: [PATCH 1/2] Chore: Format `pyproject.toml` using recent `pyproject-fmt` --- cratedb_sqlparse_py/pyproject.toml | 159 ++++++++++++++--------------- 1 file changed, 75 insertions(+), 84 deletions(-) diff --git a/cratedb_sqlparse_py/pyproject.toml b/cratedb_sqlparse_py/pyproject.toml index 2055850..b051331 100644 --- a/cratedb_sqlparse_py/pyproject.toml +++ b/cratedb_sqlparse_py/pyproject.toml @@ -5,16 +5,6 @@ requires = [ "versioningit", ] -[tool.versioningit.vcs] -method = "git" -default-tag = "0.0.0" - -[tool.versioningit.next-version] -method = "smallest" - -[tool.versioningit.format] -distance = "{next_version}" - [project] name = "cratedb-sqlparse" description = "Parsing utilities to validate and split SQL statements for CrateDB." @@ -76,58 +66,75 @@ dynamic = [ dependencies = [ "antlr4-python3-runtime<4.14", ] -[project.optional-dependencies] -develop = [ +optional-dependencies.develop = [ "mypy<1.15", + "packaging", "poethepoet<0.33", "pyproject-fmt<2.6", "ruff<0.10", "validate-pyproject<0.24", ] -generate = [ +optional-dependencies.generate = [ "antlr4-tools<0.3", "requests<3", ] -release = [ +optional-dependencies.release = [ "build<2", "twine<7", ] -test = [ +optional-dependencies.test = [ "pytest<9", "pytest-cov<7", ] -[project.urls] -changelog = "https://github.com/crate/cratedb-sqlparse/blob/main/CHANGES.md" -documentation = "https://github.com/crate/cratedb-sqlparse" -homepage = "https://github.com/crate/cratedb-sqlparse" -repository = "https://github.com/crate/cratedb-sqlparse" +urls.changelog = "https://github.com/crate/cratedb-sqlparse/blob/main/CHANGES.md" +urls.documentation = "https://github.com/crate/cratedb-sqlparse" +urls.homepage = "https://github.com/crate/cratedb-sqlparse" +urls.repository = "https://github.com/crate/cratedb-sqlparse" + +[tool.setuptools.packages.find] +namespaces = false [tool.black] line-length = 120 -[tool.coverage.run] -branch = false -omit = [ - "tests/*", - "cratedb_sqlparse/generated_parser/*" +[tool.ruff] +line-length = 120 + +lint.select = [ + # Builtins + "A", + # Bugbear + "B", + # comprehensions + "C4", + # Pycodestyle + "E", + # eradicate + "ERA", + # Pyflakes + "F", + # isort + "I", + # pandas-vet + "PD", + # return + "RET", + # Bandit + "S", + # print + "T20", + "W", + # flake8-2020 + "YTT", ] -source = ["cratedb_sqlparse"] -[tool.coverage.report] -fail_under = 0 -show_missing = true +lint.extend-ignore = [ + "RET504", # Unnecessary variable assignment before `return` statement + "RET505", # Unnecessary `elif` after `return` statement +] -[tool.mypy] -packages = ["cratedb_sqlparse"] -install_types = true -ignore_missing_imports = true -implicit_optional = true -non_interactive = true -# FIXME: Does not work? -exclude = [ - "^SqlBaseLexer\\.py$", - "cratedb_sqlparse/generated_parser/", - "cratedb_sqlparse/generated_parser/SqlBaseParser.py", +lint.per-file-ignores."tests/*" = [ + "S101", # Use of `assert` detected. ] [tool.pytest.ini_options] @@ -147,56 +154,40 @@ xfail_strict = true markers = [ ] -[tool.ruff] -line-length = 120 - -lint.select = [ - # Bandit - "S", - # Bugbear - "B", - # Builtins - "A", - # comprehensions - "C4", - # eradicate - "ERA", - # flake8-2020 - "YTT", - # isort - "I", - # pandas-vet - "PD", - # print - "T20", - # Pycodestyle - "E", - "W", - # Pyflakes - "F", - # return - "RET", +[tool.coverage.run] +branch = false +omit = [ + "tests/*", + "cratedb_sqlparse/generated_parser/*", ] +source = [ "cratedb_sqlparse" ] -lint.extend-ignore = [ - # Unnecessary variable assignment before `return` statement - "RET504", - # Unnecessary `elif` after `return` statement - "RET505", -] +[tool.coverage.report] +fail_under = 0 +show_missing = true -[tool.ruff.lint.per-file-ignores] -"tests/*" = [ - # Use of `assert` detected. - "S101", -] -"influxio/util/report.py" = [ - "T201", +[tool.mypy] +packages = [ "cratedb_sqlparse" ] +install_types = true +ignore_missing_imports = true +implicit_optional = true +non_interactive = true +# FIXME: Does not work? +exclude = [ + "^SqlBaseLexer\\.py$", + "cratedb_sqlparse/generated_parser/", + "cratedb_sqlparse/generated_parser/SqlBaseParser.py", ] -[tool.setuptools.packages.find] -namespaces = false +[tool.versioningit.vcs] +method = "git" +default-tag = "0.0.0" +[tool.versioningit.next-version] +method = "smallest" + +[tool.versioningit.format] +distance = "{next_version}" # =================== # Tasks configuration From 031cf9166d8b6724d221ce345b5dd667e8a974ab Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Wed, 15 Jan 2025 23:04:15 +0100 Subject: [PATCH 2/2] CI: Validate on Python 3.13 --- .github/workflows/python.yml | 2 +- cratedb_sqlparse_py/pyproject.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index aa0777c..942d905 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -32,7 +32,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest"] - python-version: ["3.8", "3.12"] + python-version: ["3.8", "3.13"] env: OS: ${{ matrix.os }} diff --git a/cratedb_sqlparse_py/pyproject.toml b/cratedb_sqlparse_py/pyproject.toml index b051331..876efaf 100644 --- a/cratedb_sqlparse_py/pyproject.toml +++ b/cratedb_sqlparse_py/pyproject.toml @@ -46,6 +46,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: SQL", "Topic :: Communications", "Topic :: Database",