forked from astronomer/astronomer-cosmos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
260 lines (237 loc) · 6.54 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "astronomer-cosmos"
dynamic = ["version"]
description = "Render 3rd party workflows in Airflow"
readme = "README.rst"
license = "Apache-2.0"
requires-python = ">=3.8"
authors = [
{ name = "Astronomer", email = "[email protected]" },
]
keywords = [
"airflow",
"apache-airflow",
"astronomer",
"dags",
"dbt",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"Framework :: Apache Airflow",
"Framework :: Apache Airflow :: Provider",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
dependencies = [
# Airflow & Pydantic issue: https://github.com/apache/airflow/issues/32311
"aenum",
"attrs",
"pydantic>=1.10.0,<2.0.0",
"apache-airflow>=2.3.0",
"importlib-metadata; python_version < '3.8'",
"Jinja2>=3.0.0",
"typing-extensions; python_version < '3.8'",
"virtualenv",
]
[project.optional-dependencies]
dbt-all = [
"dbt-athena",
"dbt-bigquery",
"dbt-databricks",
"dbt-exasol",
"dbt-postgres",
"dbt-redshift",
"dbt-snowflake",
"dbt-spark",
"dbt-vertica",
]
dbt-athena = [
"dbt-athena-community",
]
dbt-bigquery = [
"dbt-bigquery",
]
dbt-databricks = [
"dbt-databricks",
]
dbt-exasol = [
"dbt-exasol",
]
dbt-postgres = [
"dbt-postgres",
]
dbt-redshift = [
"dbt-redshift",
]
dbt-snowflake = [
"dbt-snowflake",
]
dbt-spark = [
"dbt-spark",
]
dbt-vertica = [
"dbt-vertica<=1.5.4",
]
openlineage = [
"openlineage-integration-common",
"openlineage-airflow",
]
all = [
"astronomer-cosmos[dbt-all]",
"astronomer-cosmos[openlineage]"
]
docs =[
"sphinx",
"pydata-sphinx-theme",
"sphinx-autobuild",
"sphinx-autoapi"
]
tests = [
"packaging",
"pytest>=6.0",
"pytest-split",
"pytest-dotenv",
"requests-mock",
"pytest-cov",
"pytest-describe",
"sqlalchemy-stubs", # Change when sqlalchemy is upgraded https://docs.sqlalchemy.org/en/14/orm/extensions/mypy.html
"types-requests",
"mypy",
"sqlalchemy-stubs", # Change when sqlalchemy is upgraded https://docs.sqlalchemy.org/en/14/orm/extensions/mypy.html
]
docker = [
"apache-airflow-providers-docker>=3.5.0",
]
kubernetes = [
"apache-airflow-providers-cncf-kubernetes>=5.1.1",
]
[project.entry-points.cosmos]
provider_info = "cosmos:get_provider_info"
[project.urls]
Homepage = "https://github.com/astronomer/astronomer-cosmos"
Documentation = "https://astronomer.github.io/astronomer-cosmos"
"Source code" = "https://github.com/astronomer/astronomer-cosmos"
[tool.hatch.version]
path = "cosmos/__init__.py"
[tool.hatch.build.targets.sdist]
include = [
"/cosmos",
]
######################################
# TESTING
######################################
[tool.hatch.envs.tests]
dependencies = [
"astronomer-cosmos[tests]",
"apache-airflow-providers-docker>=3.5.0",
"apache-airflow-providers-cncf-kubernetes>=5.1.1",
"types-PyYAML",
"types-attrs",
"types-requests",
"types-python-dateutil",
"apache-airflow",
"Werkzeug<3.0.0",
]
[[tool.hatch.envs.tests.matrix]]
python = ["3.8", "3.9", "3.10"]
airflow = ["2.3", "2.4", "2.5", "2.6", "2.7"]
[tool.hatch.envs.tests.overrides]
matrix.airflow.dependencies = [
{ value = "apache-airflow==2.3", if = ["2.3"] },
{ value = "apache-airflow==2.4", if = ["2.4"] },
{ value = "apache-airflow==2.5", if = ["2.5"] },
{ value = "apache-airflow==2.6", if = ["2.6"] },
{ value = "apache-airflow==2.7", if = ["2.7"] },
]
[tool.hatch.envs.tests.scripts]
freeze = "pip freeze"
type-check = "mypy cosmos"
test = 'pytest -vv --durations=0 . -m "not integration" --ignore=tests/test_example_dags.py --ignore=tests/test_example_dags_no_connections.py'
test-cov = """pytest -vv --cov=cosmos --cov-report=term-missing --cov-report=xml --durations=0 -m "not integration" --ignore=tests/test_example_dags.py --ignore=tests/test_example_dags_no_connections.py"""
# we install using the following workaround to overcome installation conflicts, such as:
# apache-airflow 2.3.0 and dbt-core [0.13.0 - 1.5.2] and jinja2>=3.0.0 because these package versions have conflicting dependencies
test-integration-setup = """pip uninstall dbt-postgres dbt-databricks dbt-vertica; \
rm -rf airflow.*; \
airflow db init; \
pip install 'dbt-core' 'dbt-databricks' 'dbt-postgres' 'dbt-vertica' 'openlineage-airflow'"""
test-integration = """rm -rf dbt/jaffle_shop/dbt_packages;
pytest -vv \
--cov=cosmos \
--cov-report=term-missing \
--cov-report=xml \
--durations=0 \
-m integration \
-k 'not (sqlite or example_cosmos_sources or example_cosmos_python_models or example_virtualenv)'"""
test-integration-expensive = """pytest -vv \
--cov=cosmos \
--cov-report=term-missing \
--cov-report=xml \
--durations=0 \
-m integration \
-k 'example_cosmos_python_models or example_virtualenv'"""
test-integration-sqlite-setup = """pip uninstall -y dbt-core dbt-sqlite openlineage-airflow openlineage-integration-common; \
rm -rf airflow.*; \
airflow db init; \
pip install 'dbt-core==1.4' 'dbt-sqlite<=1.4' 'dbt-databricks<=1.4' 'dbt-postgres<=1.4' """
test-integration-sqlite = """
pytest -vv \
--cov=cosmos \
--cov-report=term-missing \
--cov-report=xml \
--durations=0 \
-m integration \
-k 'example_cosmos_sources or sqlite'"""
[tool.pytest.ini_options]
filterwarnings = [
"ignore::DeprecationWarning",
]
minversion = "6.0"
markers = [
"integration",
"sqlite"
]
######################################
# DOCS
######################################
[tool.hatch.envs.docs]
dependencies = [
"aenum",
"sphinx",
"pydata-sphinx-theme",
"sphinx-autobuild",
"sphinx-autoapi",
"openlineage-airflow",
]
[tool.hatch.envs.docs.scripts]
build = "sphinx-build -b html docs docs/_build"
serve = "sphinx-autobuild docs docs/_build"
######################################
# THIRD PARTY TOOLS
######################################
[tool.black]
line-length = 120
target-version = ['py37', 'py38', 'py39', 'py310']
[tool.isort]
profile = "black"
known_third_party = ["airflow", "jinja2"]
[tool.mypy]
strict = true
ignore_missing_imports = true
no_warn_unused_ignores = true
[tool.ruff]
line-length = 120
[tool.distutils.bdist_wheel]
universal = true
[tool.flake8]
max-complexity = 10
select = "C"