-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathpyproject.toml
More file actions
264 lines (245 loc) · 7.7 KB
/
pyproject.toml
File metadata and controls
264 lines (245 loc) · 7.7 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
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "sqlit-tui"
description = "A terminal UI for SQL Server, PostgreSQL, MySQL, SQLite, Oracle, and more"
readme = "README.md"
license = "MIT"
requires-python = ">=3.10"
authors = [
{ name = "Peter" }
]
keywords = ["sql", "server", "tui", "database", "mssql", "postgresql", "mysql", "sqlite", "oracle", "firebird", "terminal"]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Database",
]
dependencies = [
"textual[syntax]>=6.10.0",
"textual-fastdatatable>=0.14.0",
"pyperclip>=1.8.2",
"keyring>=24.0.0",
"docker>=7.0.0",
"sqlparse>=0.5.0",
]
dynamic = ["version"]
[project.optional-dependencies]
all = [
"psycopg2-binary>=2.9.0",
"mssql-python>=1.1.0",
"PyMySQL>=1.1.0",
"mariadb>=1.1.0",
"oracledb>=2.0.0",
"ibm_db>=3.2.0",
"hdbcli>=2.20.0",
"teradatasql>=20.0.0",
"trino>=0.329.0",
"presto-python-client>=0.8.4",
"google-cloud-bigquery",
"google-cloud-spanner>=3.0.0",
"duckdb>=1.1.0", # min avoids known CVEs
"clickhouse-connect>=0.7.0",
"requests>=2.32.4", # min avoids known CVEs
"libsql>=0.1.0",
"firebirdsql>=1.3.5",
"sshtunnel>=0.4.0",
"paramiko>=2.0.0,<4.0.0",
"snowflake-connector-python>=3.7.0",
"redshift-connector",
"pyathena>=3.22.0",
"adbc-driver-flightsql>=1.0.0",
]
postgres = ["psycopg2-binary>=2.9.0"]
cockroachdb = ["psycopg2-binary>=2.9.0"]
mssql = ["mssql-python>=1.1.0"]
mysql = ["PyMySQL>=1.1.0"]
mariadb = ["mariadb>=1.1.0"]
oracle = ["oracledb>=2.0.0"]
db2 = ["ibm_db>=3.2.0"]
hana = ["hdbcli>=2.20.0"]
teradata = ["teradatasql>=20.0.0"]
trino = ["trino>=0.329.0"]
presto = ["presto-python-client>=0.8.4"]
bigquery = ["google-cloud-bigquery"]
spanner = ["google-cloud-spanner>=3.0.0"]
redshift = ["redshift-connector"]
duckdb = ["duckdb>=1.1.0"] # min avoids known CVEs
clickhouse = ["clickhouse-connect>=0.7.0"]
d1 = ["requests>=2.32.4"] # min avoids known CVEs
turso = ["libsql>=0.1.0"]
firebird = ["firebirdsql>=1.3.5"]
snowflake = ["snowflake-connector-python>=3.7.0"]
athena = ["pyathena>=3.22.0"]
flight = ["adbc-driver-flightsql>=1.0.0"]
ssh = [
"sshtunnel>=0.4.0",
"paramiko>=2.0.0,<4.0.0",
]
[dependency-groups]
test = [
"pytest>=7.0",
"pytest-timeout>=2.0",
"pytest-asyncio>=0.23.0",
"pytest-cov>=4.0",
"fakesnow>=0.0.1",
]
dev = [
{ include-group = "test" },
"pytest-benchmark>=4.0",
"Faker>=28.0",
"build",
"ruff>=0.8.0",
"mypy>=1.0",
"pre-commit>=3.0",
]
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "sqlit/_version.py"
[tool.ruff]
target-version = "py310"
line-length = 240
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear (common gotchas)
"S", # flake8-bandit (security)
"C90", # mccabe complexity
"SIM", # flake8-simplify
"RUF", # ruff-specific rules
]
ignore = [
"S101", # assert used (fine for internal checks)
"S603", # subprocess without shell=True (intentional - CLI tool)
"S607", # partial executable path (CLI tool needs to call system commands)
"S608", # SQL injection (this is a SQL tool - queries are intentional)
"S301", # pickle (if used, likely intentional)
"S110", # try-except-pass (intentional for TUI resilience - prevents UI crashes)
"SIM105", # contextlib.suppress (same as S110 - try-except-pass is clearer here)
"SIM108", # ternary operator (if-else is often more readable)
"S105", # hardcoded password (false positives on enum values and parameter names)
"S106", # hardcoded password func arg (false positives - these are type indicators)
"S107", # hardcoded password default (false positive - password_type parameter)
"RUF012", # mutable class default (Textual BINDINGS pattern - framework convention)
"SIM102", # collapsible if (explicit nesting often clearer)
"RUF005", # collection concatenation (+ is clearer than unpacking for small lists)
"B905", # zip strict (not needed for same-length internal data)
"S606", # start process no shell (os.execv is intentional for restart)
"S602", # subprocess shell=True (intentional for Windows terminal launch)
"S103", # chmod permissive (755 needed for executable scripts)
"SIM118", # dict.keys() iteration (works fine, minor style preference)
"SIM103", # needless bool return (explicit is clearer)
"SIM101", # duplicate isinstance (split checks can be clearer)
"SIM115", # open context manager (not needed for immediate .read())
"RUF022", # unsorted __all__ (organized by category is better than alphabetical)
]
[tool.ruff.lint.mccabe]
max-complexity = 25 # complex domain logic in cloud providers and TUI screens
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101", "S106", "S108"]
"sqlit/domains/query/completion/completion.py" = ["C901"] # SQL autocomplete is inherently complex
[project.scripts]
sqlit = "sqlit.cli:main"
[project.urls]
Homepage = "https://github.com/Maxteabag/sqlit"
Repository = "https://github.com/Maxteabag/sqlit"
Issues = "https://github.com/Maxteabag/sqlit/issues"
[tool.hatch.build.targets.wheel]
packages = ["sqlit"]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
addopts = "-v"
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
markers = [
"sqlite: SQLite database tests",
"mssql: SQL Server database tests",
"postgresql: PostgreSQL database tests",
"mysql: MySQL database tests",
"oracle: Oracle database tests",
"firebird: Firebird database tests",
"clickhouse: ClickHouse database tests",
"flight: Apache Arrow Flight SQL database tests",
"spanner: Google Cloud Spanner database tests",
"asyncio: async tests",
"integration: integration tests (may require external services)",
]
[tool.coverage.run]
source = ["sqlit"]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_ignores = true
disallow_untyped_defs = true
check_untyped_defs = true
warn_redundant_casts = true
strict_optional = true
exclude = ["tests/"]
namespace_packages = true
[[tool.mypy.overrides]]
module = [
"pymysql",
"mariadb",
"oracledb",
"duckdb",
"clickhouse_connect",
"libsql",
"snowflake.connector",
"sshtunnel",
"docker",
"docker.errors",
"ibm_db",
"ibm_db_dbi",
"hdbcli",
"hdbcli.dbapi",
"teradatasql",
"trino",
"trino.dbapi",
"trino.auth",
"prestodb",
"prestodb.dbapi",
"prestodb.auth",
"pyarrow",
"pyarrow.flight",
"adbc_driver_flightsql",
"adbc_driver_flightsql.dbapi",
"adbc_driver_manager",
"textual_fastdatatable",
"google.cloud",
"google.cloud.bigquery",
"google.cloud.bigquery.dbapi",
"google.cloud.spanner",
"google.cloud.spanner_dbapi",
"google.api_core",
"google.api_core.client_options",
"google.auth",
"google.auth.credentials",
"google.oauth2",
"google.oauth2.service_account",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "mssql_python"
ignore_missing_imports = true