-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
331 lines (294 loc) · 8.94 KB
/
pyproject.toml
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
[build-system]
requires = ["hatchling", "versioningit"]
build-backend = "hatchling.build"
[project]
name = "dagcellent"
dynamic = ["version"]
description = ''
readme = "README.md"
requires-python = ">=3.11"
license = "MIT"
keywords = ["apache-airflow", "dag", "data"]
authors = [
{ name = "Timon Viola", email = "viotimo@dfds.com" },
]
classifiers = [
"Development Status :: 6 - Mature",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"License :: OSI Approved :: MIT License",
"Framework :: Apache Airflow",
"Framework :: Apache Airflow :: Provider",
]
dependencies = [
"apache-airflow>=2.9.1",
"apache-airflow-providers-amazon>=7.2.0",
"apache-airflow-providers-microsoft-mssql >=3.2.0",
"apache-airflow-providers-snowflake >= 5.1",
"apache-airflow-providers-common-sql[pandas,openlineage]",
"tomli >= 2.0.1",
"pyyaml>= 6.0.1",
"pydantic >= 2.1.0",
"pandas > 2.0.0",
"awswrangler[redshift, postgres, sqlserver, deltalake] > 3.0.0",
"pyarrow >= 17.0.0",
"mlflow-skinny >= 2.17.2"
]
[project.urls]
Homepage = "https://compass.dfds.cloud/dagcellent/"
Documentation = "https://verbose-adventure-nvr2zl5.pages.github.io/"
Issues = "https://github.com/dfds-data/dagcellent/issues"
Source = "https://github.com/dfds-data/dagcellent"
[tool.hatch.build.targets.sdist]
exclude = [
"/.*",
"/docs",
"/tests"
]
[tool.hatch.build.targets.wheel]
packages = ["src/dagcellent"]
[tool.hatch.envs.default]
installer = "uv"
[tool.hatch.envs.dev]
extra-dependencies = [
"pre-commit == 3.7.*",
"ruff == 0.4.4",
"mypy == 1.10.*",
"versioningit == 3.1.*",
"towncrier == 23.11.*",
]
[tool.hatch.envs.dev.scripts]
install = "pre-commit install --hook-type commit-msg"
version = "versioningit"
changelog = "git-cliff -o CHANGELOG.md"
[tool.hatch.envs.types]
extra-dependencies = [
"mypy>=1.0.0",
]
[tool.hatch.envs.types.scripts]
check = "mypy --install-types --non-interactive {args:src/dagcellent tests}"
[tool.hatch.envs.docs]
extra-dependencies = [
"mkdocs-material",
"mkdocstrings",
"mkdocstrings-python",
"mkdocs-git-revision-date-localized-plugin",
]
[tool.hatch.envs.docs.scripts]
serve = "mkdocs serve"
build = "mkdocs build"
[tool.hatch.envs.test]
extra-dependencies = [
"pytest >= 8.0.0",
"pytest-cov",
"pytest-mock >= 3.14.0",
]
[[tool.hatch.envs.test.matrix]]
python = ["3.11", "3.12"]
[tool.hatch.envs.test.scripts]
test = "pytest --cov=dagcellent --cov-report=term-missing --cov-report=xml --cov-report=html tests"
[tool.hatch.version]
source = "versioningit"
[tool.coverage.run]
source_pkgs = ["dagcellent", "tests"]
branch = true
parallel = true
omit = [
"src/dagcellent/__about__.py",
]
[tool.coverage.paths]
dagcellent = ["src/dagcellent", "*/dagcellent/src/dagcellent"]
tests = ["tests", "*/dagcellent/tests"]
[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
# ---- My tools -----
[tool.towncrier]
# The name of your Python package
package = "dagcellent"
# The path to your Python package.
# If your package lives in 'src/myproject/', it must be 'src',
# but if you don't keep your code in a 'src' dir, remove the
# config option
package_dir = "src"
# Where you want your news files to come out. This can be .rst
# or .md, towncrier's default template works with both.
filename = "docs/changelog.rst"
directory = "docs/changes"
[[tool.towncrier.type]]
directory = "deprecation"
name = "Deprecations"
showcontent = true
[[tool.towncrier.type]]
directory = "feature"
name = "Features"
showcontent = true
[[tool.towncrier.type]]
directory = "bugfix"
name = "Bug Fixes"
showcontent = true
[[tool.towncrier.type]]
directory = "removal"
name = "Removals"
showcontent = true
[[tool.towncrier.type]]
directory = "docs"
name = "Documentation"
showcontent = true
[[tool.towncrier.type]]
directory = "misc"
name = "Miscellaneous"
showcontent = true
[tool.basedpyright]
include = ["src"]
exclude = ["**/__pycache__",
"src/experimental",
"src/typestubs"
]
ignore = ["src/dagcellent/newfragments"]
defineConstant = { DEBUG = true }
typeCheckingMode = "strict"
reportMissingImports = true
reportMissingTypeStubs = false
# stubPath = "src/stubs"
pythonVersion = "3.11"
pythonPlatform = "Linux"
executionEnvironments = [
{ root = "src" }
]
venvPath = ".venv"
venv = "dev"
[tool.ruff]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
[tool.ruff.lint]
typing-modules = ["airflow.typing_compat"]
extend-select = [
# Enable entire ruff rule section
"I", # Missing required import (auto-fixable)
"UP", # Pyupgrade
"ASYNC", # subset of flake8-async rules
"ISC", # Checks for implicit literal string concatenation (auto-fixable)
"TCH", # Rules around TYPE_CHECKING blocks
"G", # flake8-logging-format rules
"LOG", # flake8-logging rules, most of them autofixable
"PT", # flake8-pytest-style rules
"TID25", # flake8-tidy-imports rules
"E", # pycodestyle rules
"W", # pycodestyle rules
# Per rule enables
"RUF006", # Checks for asyncio dangling task
"RUF015", # Checks for unnecessary iterable allocation for first element
"RUF019", # Checks for unnecessary key check
"RUF100", # Unused noqa (auto-fixable)
# We ignore more pydocstyle than we enable, so be more selective at what we enable
"D101",
"D106",
"D2",
"D3",
"D400",
"D401",
"D402",
"D403",
"D412",
"D419",
"PGH004", # Use specific rule codes when using noqa
"PGH005", # Invalid unittest.mock.Mock methods/attributes/properties
"S101", # Checks use `assert` outside the test cases, test cases should be added into the exclusions
"B004", # Checks for use of hasattr(x, "__call__") and replaces it with callable(x)
"B006", # Checks for uses of mutable objects as function argument defaults.
"B007", # Checks for unused variables in the loop
"B017", # Checks for pytest.raises context managers that catch Exception or BaseException.
"B019", # Use of functools.lru_cache or functools.cache on methods can lead to memory leaks
"B028", # No explicit stacklevel keyword argument found
"TRY002", # Prohibit use of `raise Exception`, use specific exceptions instead.
]
ignore = [
"D203",
"D212",
"D213",
"D214",
"D215",
"E731", # Do not assign a lambda expression, use a def
"TC003", # Do not move imports from stdlib to TYPE_CHECKING block
"PT006", # Wrong type of names in @pytest.mark.parametrize
"PT007", # Wrong type of values in @pytest.mark.parametrize
"PT011", # pytest.raises() is too broad, set the match parameter
"PT019", # fixture without value is injected as parameter, use @pytest.mark.usefixtures instead
# Rules below explicitly set off which could overlap with Ruff's formatter
# as it recommended by https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
# Except ISC rules
"W191",
"E111",
"E114",
"E117",
"D206",
"D300",
"Q000",
"Q001",
"Q002",
"Q003",
"COM812",
"COM819",
"E501", # Formatted code may exceed the line length, leading to line-too-long (E501) errors.
"ISC001", # Conflicts with formatter
]
unfixable = [
# PT022 replace empty `yield` to empty `return`. Might be fixed with a combination of PLR1711
# In addition, it can't do anything with invalid typing annotations, protected by mypy.
"PT022",
]
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
combine-as-imports = true
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["D", "S101"]
[tool.ruff.lint.flake8-tidy-imports]
# Disallow all relative imports.
ban-relative-imports = "all"
# Ban certain modules from being imported at module level, instead requiring
# that they're imported lazily (e.g., within a function definition).
banned-module-level-imports = ["numpy", "pandas"]
[tool.ruff.lint.flake8-type-checking]
exempt-modules = ["typing", "typing_extensions"]
[tool.ruff.lint.flake8-pytest-style]
mark-parentheses = false
fixture-parentheses = false
[tool.mypy]
ignore_missing_imports = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = false
pretty = true
show_error_codes = true
disable_error_code = [
"annotation-unchecked",
]
exclude = [
"examles/*",
]
[tool.versioningit]
default-version = "0.0.0-unknown"
[tool.versioningit.vcs]
# The method key:
method = "git" # <- The method name
# Parameters to pass to the method:
match = ["v*"]
default-tag = "0.0.1"
[tool.hatch.build.hooks.versioningit-onbuild]
source-file = "src/dagcellent/__init__.py"
build-file = "dagcellent/__init__.py"
require-match = true
[tool.versioningit.format]
distance = "{next_version}.dev{distance}+{vcs}{rev}"
dirty = "{version}+dirty"
distance-dirty = "{next_version}.dev{distance}+{vcs}{rev}.dirty"