Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
280 lines (259 loc) · 7.02 KB
/
Copy pathpyproject.toml
File metadata and controls
280 lines (259 loc) · 7.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
[project]
name = "PyAthena"
description = "Python DB API 2.0 (PEP 249) client for Amazon Athena"
authors = [
{name = "The PyAthena authors"},
]
maintainers = [
{name = "laughingman7743", email = "laughingman7743@gmail.com"},
]
dependencies = [
"boto3>=1.43.31",
"botocore>=1.43.31",
"tenacity>=8.0.1",
"fsspec>=2026.9.0",
"tzdata>=2024.2",
]
requires-python = ">=3.11"
readme = "README.md"
license = "MIT"
license-files = ["LICENSE", "NOTICE"]
keywords = [
"athena",
"aws",
"amazon-athena",
"dbapi",
"pep249",
"sql",
"sqlalchemy",
"pandas",
"pyarrow",
"polars",
"fsspec",
"s3",
"spark",
"asyncio",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: AsyncIO",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Topic :: Database",
"Topic :: Database :: Front-Ends",
"Typing :: Typed",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
]
dynamic = ["version"]
[project.urls]
homepage = "https://pyathena.dev/"
repository = "https://github.com/pyathena-dev/PyAthena/"
documentation = "https://pyathena.dev/"
issues = "https://github.com/pyathena-dev/PyAthena/issues"
changelog = "https://github.com/pyathena-dev/PyAthena/releases"
[project.entry-points."sqlalchemy.dialects"]
awsathena = "pyathena.sqlalchemy.rest:AthenaRestDialect"
"awsathena.rest" = "pyathena.sqlalchemy.rest:AthenaRestDialect"
"awsathena.pandas" = "pyathena.sqlalchemy.pandas:AthenaPandasDialect"
"awsathena.arrow" = "pyathena.sqlalchemy.arrow:AthenaArrowDialect"
"awsathena.polars" = "pyathena.sqlalchemy.polars:AthenaPolarsDialect"
"awsathena.s3fs" = "pyathena.sqlalchemy.s3fs:AthenaS3FSDialect"
"awsathena.aiorest" = "pyathena.aio.sqlalchemy.rest:AthenaAioRestDialect"
"awsathena.aiopandas" = "pyathena.aio.sqlalchemy.pandas:AthenaAioPandasDialect"
"awsathena.aioarrow" = "pyathena.aio.sqlalchemy.arrow:AthenaAioArrowDialect"
"awsathena.aiopolars" = "pyathena.aio.sqlalchemy.polars:AthenaAioPolarsDialect"
"awsathena.aios3fs" = "pyathena.aio.sqlalchemy.s3fs:AthenaAioS3FSDialect"
[project.optional-dependencies]
sqlalchemy = ["sqlalchemy>=2.0.0"]
aiosqlalchemy = [
"sqlalchemy[asyncio]>=2.0.0",
]
pandas = [
"pandas>=3.0.0",
]
arrow = [
"pyarrow>=22.0.0",
]
polars = [
"polars>=1.39.0",
]
[dependency-groups]
dev = [
"sqlalchemy[asyncio]>=2.0.0",
"pandas>=3.0.0",
"pyarrow>=22.0.0",
"polars>=1.39.0",
# Python 3.14 and later, including the newest version that pull requests test,
# use Polars 2; Polars 1.x Series methods return None on Python 3.15
# (pola-rs/polars#29419). The older versions keep the newest Polars 1.x release.
"polars>=2.0.0; python_version >= '3.14'",
"polars<2.0.0; python_version < '3.14'",
"Jinja2>=3.1.0",
"mypy>=0.900",
"pytest>=3.5",
"pytest-cov",
"pytest-asyncio",
"pytest-xdist",
"pytest-dependency",
"pytest-rerunfailures",
"sphinx",
"sphinx-multiversion",
"sphinxext-opengraph",
"furo",
"myst-parser",
"sphinx-design",
"cfn-lint>=1",
]
[build-system]
requires = ["hatchling>=1.27", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.sdist]
ignore-vcs = true
only-include = [
"pyathena/",
"LICENSE",
"pyproject.toml",
"README.md"
]
[tool.hatch.build.targets.wheel]
packages = ["pyathena"]
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "pyathena/_version.py"
[tool.uv]
# pyarrow 26.0.0 is the first release with Python 3.15 wheels; without this, every
# resolution of the lock keeps the version that the benchmarks' awswrangler allows.
constraint-dependencies = ["pyarrow>=26.0.0; python_version >= '3.15'"]
# The benchmark measures PolarsCursor in one environment per Polars major version;
# the root development group pins Polars by Python version instead.
conflicts = [
[
{ package = "pyathena", group = "dev" },
{ package = "pyathena-benchmarks", group = "polars1" },
{ package = "pyathena-benchmarks", group = "polars2" },
],
]
[tool.uv.workspace]
members = ["benchmarks"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
norecursedirs = [
"benchmarks",
".venv",
".tox",
"docs.*",
]
[tool.ruff]
line-length = 100
exclude = [
".venv",
".tox",
"benchmarks",
]
target-version = "py311"
[tool.ruff.lint]
# https://docs.astral.sh/ruff/rules/
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"RET", # flake8-return
"UP", # pyupgrade
"PIE", # flake8-pie
"PERF", # perflint
"T20", # flake8-print
"FLY", # flynt
"ISC", # flake8-implicit-str-concat
"RSE", # flake8-raise
"RUF", # ruff-specific rules
"PGH", # pygrep-hooks
"G", # flake8-logging-format
"PT", # flake8-pytest-style
"D", # pydocstyle
]
ignore = [
"RUF059", # unused-unpacked-variable (too noisy for interface-heavy code)
"G004", # logging-f-string (f-strings are preferred for log messages)
"D105", # undocumented-magic-method (protocol methods need no docstring)
]
[tool.ruff.lint.pydocstyle]
convention = "google"
# Overrides marked with @override inherit the base method's documentation.
ignore-decorators = ["pyathena.util.override"]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"RUF012", # mutable-class-default (test classes often use mutable defaults)
]
"!pyathena/**" = [
"D", # docstring rules apply to the package only
]
"pyathena/sqlalchemy/compiler.py" = [
"N802", # SQLAlchemy TypeCompiler requires visit_UPPERCASE method names
]
[tool.mypy]
follow_imports = "silent"
disallow_any_generics = true
strict_optional = true
check_untyped_defs = true
allow_redefinition = true
ignore_missing_imports = true
warn_redundant_casts = true
warn_no_return = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
# Overrides are marked with pyathena.util.override (PEP 698).
enable_error_code = ["explicit-override"]
exclude = [
"benchmarks.*",
"tests.*",
".venv.*",
".tox.*",
"docs.*",
]
[tool.tox]
legacy_tox_ini = """
[tox]
isolated_build = true
envlist = py{311,312,313,314,315}-{pyathena,sqla,sqla_async}
[gh-actions]
python =
3.11: py311
3.12: py312
3.13: py313
3.14: py314
3.15: py315
[gh-actions:env]
TEST_TYPE =
pyathena: pyathena
sqla: sqla
sqla_async: sqla_async
[testenv]
allowlist_externals =
uv
uvx
just
commands =
uv sync --group dev
pyathena: just test pyathena
sqla: just test sqla
sqla_async: just test sqla-async
passenv =
TOXENV
PYTEST_ADDOPTS
AWS_*
GITHUB_*
"""