Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit 4a0baba

Browse files
Merge branch 'main' into feat/custom-types
2 parents a752861 + 605cdc0 commit 4a0baba

9 files changed

Lines changed: 122 additions & 77 deletions

File tree

.github/workflows/release.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
16-
- uses: actions/setup-python@v4
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
1717
with:
18-
python-version: 3.8
18+
python-version: 3.12
1919
- name: Install dependencies
2020
env:
2121
PIP_CONSTRAINT: .github/workflows/constraints.txt
@@ -34,7 +34,7 @@ jobs:
3434
needs: build
3535
environment: publish
3636
steps:
37-
- uses: actions/checkout@v3
37+
- uses: actions/checkout@v4
3838
- uses: actions/download-artifact@v3
3939
with:
4040
name: dist
@@ -48,4 +48,4 @@ jobs:
4848
file_glob: true
4949

5050
- name: Publish
51-
uses: pypa/[email protected].10
51+
uses: pypa/[email protected].11

.github/workflows/test.yaml

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ on:
77
- src/**
88
- tests/**
99
- pyproject.toml
10-
- .github/workflows/test.yml
10+
- .github/workflows/test.yaml
1111
- .github/workflows/constraints.txt
1212
pull_request:
1313
branches: [ main ]
1414
paths:
1515
- src/**
1616
- tests/**
1717
- pyproject.toml
18-
- .github/workflows/test.yml
18+
- .github/workflows/test.yaml
1919
- .github/workflows/constraints.txt
2020
workflow_dispatch: {}
2121
schedule:
@@ -31,11 +31,11 @@ jobs:
3131
name: Lint
3232
runs-on: ubuntu-latest
3333
steps:
34-
- uses: actions/checkout@v3
35-
- uses: actions/setup-python@v4
34+
- uses: actions/checkout@v4
35+
- uses: actions/setup-python@v5
3636
with:
3737
cache: pip
38-
python-version: "3.11"
38+
python-version: "3.12"
3939
- name: Install dependencies
4040
env:
4141
PIP_CONSTRAINT: .github/workflows/constraints.txt
@@ -51,11 +51,11 @@ jobs:
5151
name: Typing
5252
runs-on: ubuntu-latest
5353
steps:
54-
- uses: actions/checkout@v3
55-
- uses: actions/setup-python@v4
54+
- uses: actions/checkout@v4
55+
- uses: actions/setup-python@v5
5656
with:
5757
cache: pip
58-
python-version: "3.11"
58+
python-version: "3.12"
5959
- name: Install dependencies
6060
env:
6161
PIP_CONSTRAINT: .github/workflows/constraints.txt
@@ -68,30 +68,44 @@ jobs:
6868
hatch run check
6969
7070
test:
71-
name: Pytest (Python ${{ matrix.python-version }}, ${{ matrix.os }}, SQLAlchemy ${{ matrix.sqlalchemy-version }})
71+
name: Pytest (Python ${{ matrix.python-version }}, ${{ matrix.os }}, SQLAlchemy ${{ matrix.sqlalchemy-version }})${{ matrix.nightly && ' (nightly)' || '' }}
7272
runs-on: ${{ matrix.os }}
73-
continue-on-error: ${{ matrix.python-version == '3.12' }}
73+
continue-on-error: ${{ matrix.python-version == '3.13' }}
7474
strategy:
7575
fail-fast: false
7676
matrix:
7777
os: ["ubuntu-latest"]
78-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
78+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
7979
sqlalchemy-version: ["1", "2"]
8080
include:
81-
- python-version: "3.11"
81+
- python-version: "3.12"
8282
sqlalchemy-version: "2"
8383
os: "windows-latest"
8484

85-
- python-version: "3.11"
85+
- python-version: "3.12"
8686
sqlalchemy-version: "2"
8787
os: "macos-latest"
88+
89+
- python-version: "3.13"
90+
sqlalchemy-version: "2"
91+
os: "ubuntu-latest"
92+
nightly: true
93+
8894
steps:
89-
- uses: actions/checkout@v3
90-
- uses: actions/setup-python@v4
95+
- uses: actions/checkout@v4
96+
- uses: actions/setup-python@v5
97+
if: "${{ !matrix.nightly }}"
9198
with:
9299
cache: pip
93100
python-version: ${{ matrix.python-version }}
94101
allow-prereleases: true
102+
architecture: x64
103+
- name: Setup Python ${{ matrix.python-version }} (nightly)
104+
if: "${{ matrix.nightly }}"
105+
uses: deadsnakes/[email protected]
106+
with:
107+
python-version: "${{ matrix.python-version }}-dev"
108+
95109
- name: Install dependencies
96110
env:
97111
PIP_CONSTRAINT: .github/workflows/constraints.txt
@@ -114,8 +128,8 @@ jobs:
114128
env:
115129
HATCH_ENV: coverage
116130
steps:
117-
- uses: actions/checkout@v3
118-
- uses: actions/setup-python@v4
131+
- uses: actions/checkout@v4
132+
- uses: actions/setup-python@v5
119133
with:
120134
python-version: "3.11"
121135
- name: Install dependencies

.pre-commit-config.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ci:
88

99
repos:
1010
- repo: https://github.com/pre-commit/pre-commit-hooks
11-
rev: v4.4.0
11+
rev: v4.5.0
1212
hooks:
1313
- id: check-merge-conflict
1414
- id: check-toml
@@ -18,12 +18,16 @@ repos:
1818
- id: trailing-whitespace
1919

2020
- repo: https://github.com/astral-sh/ruff-pre-commit
21-
rev: v0.0.291
21+
rev: v0.1.7
2222
hooks:
2323
- id: ruff
24-
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
24+
name: Ruff lint
25+
args: [--fix, --preview, --exit-non-zero-on-fix, --show-fixes]
26+
- id: ruff
27+
name: Ruff format
28+
entry: ruff format
2529

2630
- repo: https://github.com/tox-dev/pyproject-fmt
27-
rev: "1.1.0"
31+
rev: "1.5.3"
2832
hooks:
2933
- id: pyproject-fmt

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
77
and is generated by [git-cliff](https://github.com/orhun/git-cliff).
88

9+
## [0.1.1] - 2023-10-6
10+
11+
### Added
12+
13+
- Official support for Python 3.12 ([#39](https://github.com/edgarrmondragon/sqlean-driver/issues/39))
14+
15+
### Testing
16+
17+
- Report version `sqlean.py` in pytest output ([#25](https://github.com/edgarrmondragon/sqlean-driver/issues/25))
18+
- Catch warnings ([#28](https://github.com/edgarrmondragon/sqlean-driver/issues/28))
19+
920
## [0.1.0] - 2023-08-14
1021

1122
### Added

pyproject.toml

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ classifiers = [
2828
"Programming Language :: Python :: 3.9",
2929
"Programming Language :: Python :: 3.10",
3030
"Programming Language :: Python :: 3.11",
31+
"Programming Language :: Python :: 3.12",
3132
"Programming Language :: Python :: Implementation :: CPython",
3233
"Programming Language :: SQL",
3334
"Topic :: Database",
@@ -41,13 +42,18 @@ dynamic = [
4142
"version",
4243
]
4344
dependencies = [
44-
"greenlet>=3.0.0a1",
4545
"sqlalchemy>=1.4",
4646
"sqlean-py>=0.21.5.1",
4747
]
4848
[project.optional-dependencies]
49-
dev = [
49+
coverage = [
50+
"coverage[toml]>=6.5",
51+
]
52+
testing = [
5053
"pytest",
54+
]
55+
typing = [
56+
"mypy>=1",
5157
'typing-extensions; python_version < "3.10"',
5258
]
5359
[project.urls]
@@ -67,53 +73,54 @@ dependencies = [
6773
"pytest-github-actions-annotate-failures",
6874
"sqlalchemy=={matrix:sqlalchemy:2}.*",
6975
]
70-
features = ["dev"]
76+
features = ["testing"]
7177
matrix-name-format = "{variable}_{value}"
7278
[tool.hatch.envs.test.env-vars]
7379
SQLALCHEMY_WARN_20 = "1"
80+
[tool.hatch.envs.test.overrides]
81+
env.GITHUB_ACTIONS.dev-mode = { value = false, if = ["true"] }
82+
7483
[tool.hatch.envs.test.scripts]
7584
run = "pytest {args:tests}"
7685
cov = "coverage run -m pytest {args:tests}"
7786

7887
[[tool.hatch.envs.test.matrix]]
7988
sqlalchemy = ["1", "2"]
80-
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]
89+
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
8190

8291
[tool.hatch.envs.coverage]
83-
dependencies = [
84-
"coverage[toml]>=6.5",
85-
]
92+
features = ["coverage"]
8693
[tool.hatch.envs.coverage.scripts]
8794
json = "coverage json"
8895
xml = "coverage xml"
89-
report = ["coverage combine", "coverage report --show-missing"]
96+
report = ["coverage combine --debug=pathmap", "coverage report --show-missing"]
9097

9198
[tool.hatch.envs.typing]
92-
dependencies = ["mypy>=1.0.0"]
93-
features = ["dev"]
99+
features = ["testing", "typing"]
94100
[tool.hatch.envs.typing.scripts]
95101
check = "mypy --strict --install-types --non-interactive {args:src/sqlean_driver tests}"
96102

97103
[tool.hatch.envs.lint]
104+
dependencies = ["ruff>=0.1"]
98105
detached = true
99-
dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
100106
[tool.hatch.envs.lint.scripts]
101-
style = ["ruff check {args:.}", "black --check --diff {args:.}"]
102-
style-gh = ["ruff check {args:.} --format github", "black --check --diff {args:.}"]
103-
fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"]
107+
style = ["ruff check {args:.}", "ruff format --check --diff {args:.}"]
108+
style-gh = ["ruff check {args:.} --output-format github", "ruff format --check --diff {args:.}"]
109+
fmt = ["ruff --fix {args:.}", "ruff format {args:.}"]
104110

105-
[tool.black]
106-
target-version = ["py38"]
111+
[tool.ruff]
107112
line-length = 100
108-
skip-string-normalization = true
113+
target-version = "py38"
109114

110-
[tool.ruff]
115+
[tool.ruff.lint]
111116
ignore = [
112117
"ANN101", # missing-type-self
113118
"ANN102", # missing-type-cls
114119
"FIX002", # line-contains-todo
120+
"COM812", # missing-trailing-comma
121+
"ISC001", # single-line-implicit-string-concatenation
115122
]
116-
line-length = 100
123+
preview = true
117124
select = [
118125
"F", # Pyflakes
119126
"E", # pycodestyle (error)
@@ -207,49 +214,51 @@ select = [
207214
"FURB132", # check-and-remove-from-set
208215
"RUF", # Ruff-specific rules
209216
]
210-
target-version = "py38"
211217
unfixable = [
212218
"ERA",
213219
"F401",
214220
]
215221

216-
[tool.ruff.isort]
222+
[tool.ruff.lint.isort]
217223
known-first-party = ["sqlean_driver"]
218224
required-imports = ["from __future__ import annotations"]
219225

220-
[tool.ruff.flake8-annotations]
226+
[tool.ruff.lint.flake8-annotations]
221227
allow-star-arg-any = true
222228

223-
[tool.ruff.flake8-import-conventions]
229+
[tool.ruff.lint.flake8-import-conventions]
224230
banned-from = ["typing"]
225231

226-
[tool.ruff.flake8-import-conventions.extend-aliases]
232+
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
227233
typing = "t"
228234

229-
[tool.ruff.flake8-tidy-imports]
235+
[tool.ruff.lint.flake8-tidy-imports]
230236
ban-relative-imports = "all"
231237

232-
[tool.ruff.pep8-naming]
238+
[tool.ruff.lint.pep8-naming]
233239
ignore-names = ["visit_*"]
234240

235-
[tool.ruff.per-file-ignores]
241+
[tool.ruff.lint.per-file-ignores]
236242
# Tests can use magic values, assertions, and relative imports
237243
"tests/**/*" = ["PLR2004", "S101", "TID252", "ANN201"]
238244

239-
[tool.ruff.pydocstyle]
245+
[tool.ruff.lint.pydocstyle]
240246
convention = "google"
241247

242248
[tool.pytest.ini_options]
243249
addopts = ["-vv", "-W error"]
244250

251+
[tool.coverage.paths]
252+
package = [
253+
"src/sqlean_driver/",
254+
"*/site-packages/sqlean_driver/",
255+
]
256+
245257
[tool.coverage.run]
246-
source_pkgs = ["sqlean_driver", "tests"]
247258
branch = true
259+
source = ["sqlean_driver", "tests"]
248260
parallel = true
249-
250-
[tool.coverage.paths]
251-
sqlean_driver = ["src/sqlean_driver", "*/sqlean-driver/src/sqlean_driver"]
252-
tests = ["tests", "*/sqlean-driver/tests"]
261+
relative_files = true
253262

254263
[tool.coverage.report]
255264
exclude_lines = [

src/sqlean_driver/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
class SQLeanTypeCompiler(SQLiteTypeCompiler):
2828
"""A type compiler for SQLite that uses sqlean.py as the DBAPI."""
2929

30-
def visit_INET(
31-
self, # noqa: PLR6301
30+
def visit_INET( # noqa: PLR6301
31+
self,
3232
type_: TypeEngine[IPAddress], # noqa: ARG002
3333
**kw: t.Any, # noqa: ARG002
3434
) -> str:
@@ -101,7 +101,7 @@ def dbapi(cls) -> ModuleType: # type: ignore[override]
101101
@classmethod
102102
def import_dbapi(cls) -> ModuleType:
103103
"""Return the DBAPI module."""
104-
import sqlean
104+
import sqlean # noqa: PLC0415
105105

106106
return sqlean # type: ignore[no-any-return]
107107

0 commit comments

Comments
 (0)