@@ -5,10 +5,6 @@ requires = [
55 " versioningit" ,
66]
77
8- [tool .versioningit .vcs ]
9- method = " git"
10- default-tag = " 0.0.0"
11-
128[project ]
139name = " sqlalchemy-cratedb"
1410description = " SQLAlchemy dialect for CrateDB."
@@ -84,34 +80,32 @@ dynamic = [
8480 " version" ,
8581]
8682dependencies = [
87- ' backports.zoneinfo<1; python_version < " 3.9" ' ,
88- " crate==1.0.0dev0 " ,
83+ " backports.zoneinfo<1; python_version<' 3.9' " ,
84+ " crate==1.0.0.dev0 " ,
8985 " geojson<4,>=2.5" ,
90- ' importlib-resources; python_version < " 3.9" ' ,
86+ " importlib-resources; python_version<' 3.9' " ,
9187 " sqlalchemy<2.1,>=1" ,
9288 " verlib2==0.2" ,
9389]
94- [project .optional-dependencies ]
95- all = [
90+ optional-dependencies.all = [
9691 " sqlalchemy-cratedb[vector]" ,
9792]
98- develop = [
99- " black<25" ,
93+ optional-dependencies.develop = [
10094 " mypy<1.12" ,
10195 " poethepoet<0.28" ,
10296 " pyproject-fmt<2.3" ,
10397 " ruff<0.7" ,
10498 " validate-pyproject<0.20" ,
10599]
106- doc = [
100+ optional-dependencies. doc = [
107101 " crate-docs-theme>=0.26.5" ,
108102 " sphinx>=3.5,<9" ,
109103]
110- release = [
104+ optional-dependencies. release = [
111105 " build<2" ,
112106 " twine<6" ,
113107]
114- test = [
108+ optional-dependencies. test = [
115109 " cratedb-toolkit[testing]" ,
116110 " dask[dataframe]" ,
117111 " pandas<2.3" ,
@@ -120,54 +114,81 @@ test = [
120114 " pytest-cov<6" ,
121115 " pytest-mock<4" ,
122116]
123- vector = [
117+ optional-dependencies. vector = [
124118 " numpy" ,
125119]
126- [project .urls ]
127- changelog = " https://github.com/crate/sqlalchemy-cratedb/blob/main/CHANGES.md"
128- documentation = " https://cratedb.com/docs/sqlalchemy-cratedb/"
129- homepage = " https://cratedb.com/docs/sqlalchemy-cratedb/"
130- repository = " https://github.com/crate/sqlalchemy-cratedb"
131- [project .entry-points ."sqlalchemy .dialects" ]
132- crate = " sqlalchemy_cratedb:dialect"
120+ urls.changelog = " https://github.com/crate/sqlalchemy-cratedb/blob/main/CHANGES.md"
121+ urls.documentation = " https://cratedb.com/docs/sqlalchemy-cratedb/"
122+ urls.homepage = " https://cratedb.com/docs/sqlalchemy-cratedb/"
123+ urls.repository = " https://github.com/crate/sqlalchemy-cratedb"
124+ entry-points."sqlalchemy.dialects".crate = " sqlalchemy_cratedb:dialect"
133125
134126[tool .black ]
135127line-length = 100
136128
137- [tool .coverage .paths ]
138- source = [
139- " src/" ,
129+ [tool .ruff ]
130+ line-length = 100
131+
132+ extend-exclude = [
140133]
141134
142- [tool .coverage .run ]
143- branch = false
144- omit = [
145- " tests/*" ,
135+ lint.select = [
136+ # Builtins
137+ " A" ,
138+ # Bugbear
139+ " B" ,
140+ # comprehensions
141+ " C4" ,
142+ # Pycodestyle
143+ " E" ,
144+ # eradicate
145+ " ERA" ,
146+ # Pyflakes
147+ " F" ,
148+ # isort
149+ " I" ,
150+ # pandas-vet
151+ " PD" ,
152+ # return
153+ " RET" ,
154+ # Bandit
155+ " S" ,
156+ # print
157+ " T20" ,
158+ " W" ,
159+ # flake8-2020
160+ " YTT" ,
146161]
147162
148- [tool .coverage .report ]
149- fail_under = 0
150- show_missing = true
151- exclude_lines = [
152- " # pragma: no cover" ,
153- " raise NotImplemented"
163+ lint.extend-ignore = [
164+ # zip() without an explicit strict= parameter
165+ " B905" ,
166+ # Unnecessary generator (rewrite as a `dict` comprehension)
167+ " C402" ,
168+ # Unnecessary `map` usage (rewrite using a `set` comprehension)
169+ " C417" ,
170+ # df is a bad variable name. Be kinder to your future self.
171+ " PD901" ,
172+ # Unnecessary variable assignment before `return` statement
173+ " RET504" ,
174+ # Unnecessary `elif` after `return` statement
175+ " RET505" ,
176+ # Probable insecure usage of temporary file or directory
177+ " S108" ,
178+ # Possible SQL injection vector through string-based query construction
179+ " S608" ,
154180]
155181
156- [tool .mypy ]
157- mypy_path = " src"
158- packages = [" sqlalchemy_cratedb" ]
159- exclude = [
182+ lint.per-file-ignores."examples/*" = [
183+ " T201" , # Allow `print`
184+ ]
185+
186+ lint.per-file-ignores."tests/*" = [
187+ " S101" , # Allow use of `assert`, and `print`
188+ " S608" , # Possible SQL injection vector through string-based query construction
189+ " W291" , # Trailing whitespace
190+ " W293" , # Blank line contains whitespace
160191]
161- check_untyped_defs = true
162- explicit_package_bases = true
163- ignore_missing_imports = true
164- implicit_optional = true
165- install_types = true
166- namespace_packages = true
167- non_interactive = true
168- # Needed until `mypy-0.990` for `ConverterDefinition` in `converter.py`.
169- # https://github.com/python/mypy/issues/731#issuecomment-1260976955
170- # enable_recursive_aliases = true
171192
172193[tool .pytest .ini_options ]
173194addopts = """
@@ -179,7 +200,7 @@ log_level = "DEBUG"
179200log_cli_level = " DEBUG"
180201log_format = " %(asctime)-15s [%(name)-36s] %(levelname)-8s: %(message)s"
181202pythonpath = [
182- " src"
203+ " src" ,
183204]
184205testpaths = [
185206 " examples" ,
@@ -194,60 +215,44 @@ xfail_strict = true
194215markers = [
195216]
196217
197- [tool .ruff ]
198- line-length = 100
199-
200- select = [
201- # Bandit
202- " S" ,
203- # Bugbear
204- " B" ,
205- # Builtins
206- " A" ,
207- # comprehensions
208- " C4" ,
209- # eradicate
210- " ERA" ,
211- # flake8-2020
212- " YTT" ,
213- # isort
214- " I" ,
215- # pandas-vet
216- " PD" ,
217- # print
218- " T20" ,
219- # Pycodestyle
220- " E" ,
221- " W" ,
222- # Pyflakes
223- " F" ,
224- # return
225- " RET" ,
218+ [tool .coverage .paths ]
219+ source = [
220+ " src/" ,
226221]
227222
228- extend-ignore = [
229- # zip() without an explicit strict= parameter
230- " B905" ,
231- # df is a bad variable name. Be kinder to your future self.
232- " PD901" ,
233- # Unnecessary variable assignment before `return` statement
234- " RET504" ,
235- # Unnecessary `elif` after `return` statement
236- " RET505" ,
237- # Probable insecure usage of temporary file or directory
238- " S108" ,
223+ [tool .coverage .run ]
224+ branch = false
225+ omit = [
226+ " tests/*" ,
239227]
240228
241- extend-exclude = [
229+ [tool .coverage .report ]
230+ fail_under = 0
231+ show_missing = true
232+ exclude_lines = [
233+ " # pragma: no cover" ,
234+ " raise NotImplemented" ,
242235]
243236
244- [tool .ruff . per-file-ignores ]
245- "*/tests/*" = [
246- " S101 " , # Allow use of `assert`, and `print`.
247- " S608 " , # Possible SQL injection vector through string-based query construction.
237+ [tool .mypy ]
238+ mypy_path = " src "
239+ packages = [ " sqlalchemy_cratedb " ]
240+ exclude = [
248241]
249- "examples/*" = [" T201" ] # Allow `print`
242+ check_untyped_defs = true
243+ explicit_package_bases = true
244+ ignore_missing_imports = true
245+ implicit_optional = true
246+ install_types = true
247+ namespace_packages = true
248+ non_interactive = true
249+ # Needed until `mypy-0.990` for `ConverterDefinition` in `converter.py`.
250+ # https://github.com/python/mypy/issues/731#issuecomment-1260976955
251+ # enable_recursive_aliases = true
250252
253+ [tool .versioningit .vcs ]
254+ method = " git"
255+ default-tag = " 0.0.0"
251256
252257# ===================
253258# Tasks configuration
@@ -256,23 +261,26 @@ extend-exclude = [
256261[tool .poe .tasks ]
257262
258263check = [
259- # "lint",
264+ " lint" ,
260265 " test" ,
261266]
262267
263268format = [
264- { cmd = " black ." },
265- # Configure Ruff not to auto-fix (remove!):
266- # unused imports (F401), unused variables (F841), `print` statements (T201), and commented-out code (ERA001).
267- { cmd = " ruff --fix --ignore=ERA --ignore=F401 --ignore=F841 --ignore=T20 --ignore=ERA001 ." },
269+ # Format project metadata.
268270 { cmd = " pyproject-fmt --keep-full-version pyproject.toml" },
271+
272+ # Format code.
273+ # Configure Ruff not to auto-fix a few items that are useful in workbench mode.
274+ # e.g.: unused imports (F401), unused variables (F841), `print` statements (T201), commented-out code (ERA001)
275+ { cmd = " ruff format" },
276+ { cmd = " ruff check --fix --ignore=ERA --ignore=F401 --ignore=F841 --ignore=T20 --ignore=ERA001" },
269277]
270278
271279lint = [
272- { cmd = " ruff . " },
273- { cmd = " black -- check . " },
280+ { cmd = " ruff format --check " },
281+ { cmd = " ruff check" },
274282 { cmd = " validate-pyproject pyproject.toml" },
275- { cmd = " mypy" },
283+ # { cmd = "mypy" },
276284]
277285
278286release = [
0 commit comments