-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathpyproject.toml
More file actions
311 lines (279 loc) · 8.73 KB
/
pyproject.toml
File metadata and controls
311 lines (279 loc) · 8.73 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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "sql-testing-library"
version = "0.22.1"
description = "SQL Testing Framework for Python: Unit test SQL queries with mock data injection for BigQuery, Snowflake, Redshift, Athena, Trino, and DuckDB. Simplify data engineering ETL testing and analytics validation."
authors = ["Gurmeet Saran <gurmeetx@gmail.com>", "Kushal Thakkar <kushal.thakkar@gmail.com>"]
maintainers = ["Gurmeet Saran <gurmeetx@gmail.com>", "Kushal Thakkar <kushal.thakkar@gmail.com>"]
license = "MIT"
readme = "README.md"
homepage = "https://gurmeetsaran.github.io/sqltesting/"
repository = "https://github.com/gurmeetsaran/sqltesting"
documentation = "https://gurmeetsaran.github.io/sqltesting/"
keywords = [
"sql",
"testing",
"unit-testing",
"mock-data",
"database-testing",
"bigquery",
"snowflake",
"redshift",
"athena",
"trino",
"duckdb",
"data-engineering",
"etl-testing",
"sql-validation",
"query-testing",
"pytest",
"data-quality",
"analytics-testing",
"sql-unit-test",
"database-mocking",
"sql-mock",
"data-warehouse-testing",
"cloud-database",
"aws-athena",
"google-bigquery",
"amazon-redshift",
"snowflake-testing",
"ci-cd-testing",
"test-automation"
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: System Administrators",
"Topic :: Software Development :: Testing",
"Topic :: Software Development :: Testing :: Unit",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Database",
"Topic :: Database :: Database Engines/Servers",
"Topic :: Scientific/Engineering :: Information Analysis",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Operating System :: OS Independent",
"Typing :: Typed",
"Natural Language :: English",
"Environment :: Console",
"Framework :: Pytest",
]
packages = [{include = "sql_testing_library", from = "src"}]
include = ["LICENSE", "README.md", "CHANGELOG.md", "py.typed", "src/sql_testing_library/py.typed"]
[tool.poetry.urls]
"Homepage" = "https://gurmeetsaran.github.io/sqltesting/"
"Documentation" = "https://gurmeetsaran.github.io/sqltesting/"
"Repository" = "https://github.com/gurmeetsaran/sqltesting"
"Bug Tracker" = "https://github.com/gurmeetsaran/sqltesting/issues"
"Changelog" = "https://github.com/gurmeetsaran/sqltesting/blob/master/CHANGELOG.md"
"Discussions" = "https://github.com/gurmeetsaran/sqltesting/discussions"
"Source Code" = "https://github.com/gurmeetsaran/sqltesting"
"Release Notes" = "https://github.com/gurmeetsaran/sqltesting/releases"
"Contributing" = "https://github.com/gurmeetsaran/sqltesting/blob/master/CONTRIBUTING.md"
[tool.poetry.dependencies]
python = ">=3.9"
sqlglot = ">=26.0.0"
pydantic = ">=2.0.0"
pandas = ">=1.0.0"
typing-extensions = {version = ">=4.5.0", python = "<3.10"}
docutils = ">=0.21.2,<0.23.0"
db-dtypes = "^1.4.3"
[tool.poetry.group.bigquery.dependencies]
google-cloud-bigquery = ">=3.0.0"
[tool.poetry.group.athena.dependencies]
boto3 = ">=1.26.0"
[tool.poetry.group.redshift.dependencies]
psycopg2-binary = ">=2.9.0"
[tool.poetry.group.trino.dependencies]
trino = ">=0.322.0"
[tool.poetry.group.snowflake.dependencies]
snowflake-connector-python = ">=3.13.1"
[tool.poetry.group.duckdb.dependencies]
duckdb = ">=0.8.0"
[tool.poetry.extras]
all = ["google-cloud-bigquery", "boto3", "psycopg2-binary", "trino", "snowflake-connector-python", "duckdb"]
bigquery = ["google-cloud-bigquery"]
athena = ["boto3"]
redshift = ["psycopg2-binary"]
trino = ["trino"]
snowflake = ["snowflake-connector-python"]
duckdb = ["duckdb"]
[tool.poetry.group.dev.dependencies]
pytest = ">=7.0.0"
pytest-asyncio = ">=0.21.0"
pytest-mock = ">=3.10.0"
pytest-cov = ">=4.1.0"
pytest-xdist = ">=3.0.0"
pytest-rerunfailures = ">=12.0.0"
black = ">=22.0.0"
flake8 = ">=4.0.0"
pyright = ">=1.1.350"
tox = ">=4.0.0"
build = ">=1.0.0"
twine = ">=4.0.0"
ruff = ">=0.0.287"
pre-commit = ">=3.5.0"
commitizen = ">=3.0.0"
faker = ">=18.0.0" # Explicit dependency to ensure it's installed in CI
mocksmith = ">=6.0.1"
[tool.poetry.plugins.pytest11]
sql_testing = "sql_testing_library._pytest_plugin"
[tool.pyright]
pythonVersion = "3.9"
include = ["src"]
exclude = ["tests", "scripts"]
reportMissingImports = true
reportMissingTypeStubs = false
reportUnusedImport = true
reportUnusedClass = true
reportUnusedFunction = true
reportUnusedVariable = true
reportDuplicateImport = true
reportUntypedFunctionDecorator = true
reportUntypedClassDecorator = true
reportUntypedBaseClass = true
reportUntypedNamedTuple = true
reportPrivateUsage = true
reportConstantRedefinition = true
reportIncompatibleMethodOverride = true
reportIncompatibleVariableOverride = true
reportInconsistentConstructor = true
strictListInference = true
reportOptionalMemberAccess = false # Optional imports pattern
reportPossiblyUnboundVariable = false # Optional imports pattern
strictDictionaryInference = true
strictSetInference = true
strictParameterNoneValue = true
[tool.ruff]
# Same as Black.
line-length = 100
indent-width = 4
target-version = "py39"
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"scripts/validate-athena-setup.py",
]
[tool.ruff.lint]
# Enable Pyflakes and pycodestyle rules.
select = ["E", "F", "I"]
# Enable flake8-bugbear rules and print statement detection.
extend-select = ["B", "T20"]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
# Prevent autofix of print statements - they should be manually reviewed and removed.
unfixable = ["T201", "T203"]
[tool.ruff.lint.per-file-ignores]
# Allow print statements in test files for debugging and output
"tests/test_*.py" = ["T201"]
"tests/*/test_*.py" = ["T201"]
# Allow print statements in example files
"examples/*.py" = ["T201"]
[tool.ruff.lint.isort]
lines-after-imports = 2
known-first-party = ["sql_testing_library"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.pytest.ini_options]
addopts = "--cov=src/sql_testing_library --cov-report=term-missing --cov-report=xml:coverage.xml --cov-report=html:htmlcov"
testpaths = ["tests"]
python_files = "test_*.py"
python_functions = "test_*"
[tool.coverage.run]
source = ["src/sql_testing_library"]
omit = [
"*/_adapters/base.py",
"*/_adapters/__init__.py",
"*/tests/*",
"*/test_*.py",
]
branch = true
concurrency = ["thread", "multiprocessing"]
[tool.coverage.report]
exclude_lines = [
# Manual exclusion
"pragma: no cover",
# Don't complain about missing debug-only code
"def __repr__",
"if self\\.debug:",
"if settings\\.DEBUG",
# Don't complain if tests don't hit defensive assertion code
"raise AssertionError",
"raise NotImplementedError",
"raise ImportError",
"raise ValueError.*unreachable",
# Don't complain if non-runnable code isn't run
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if typing\\.TYPE_CHECKING:",
# Abstract methods and classes
"@abstract",
"@abstractmethod",
"class .*\\bProtocol\\):",
"class .*\\bAbstract.*\\):",
"raise NotImplementedError.*",
# Exception handling for optional imports
"except ImportError:",
"except ModuleNotFoundError:",
"HAS_.* = False",
"HAS_.* = True",
".*_module = None",
# Skip empty functions/methods and ellipsis
"^\\s*pass\\s*$",
"^\\s*\\.\\.\\.\\s*$",
# Type annotation-only lines
"^\\s*\\.\\.\\.$",
# Platform specific code that may not be tested
"if sys\\.platform",
"if os\\.name",
# Version checks
"if sys\\.version_info",
]
show_missing = true
skip_covered = false
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "$version"
version_scheme = "pep440"
version_provider = "poetry"
update_changelog_on_bump = true
major_version_zero = true
changelog_merge_prerelease = true
changelog_start_rev = "0.1.0"
version_files = [
"src/sql_testing_library/__init__.py:__version__"
]