-
Notifications
You must be signed in to change notification settings - Fork 96
/
pyproject.toml
208 lines (164 loc) · 5.83 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
[build-system]
requires = ["hatchling~=1.14.0", "hatch-requirements-txt >= 0.4.1, <0.5.0"]
build-backend = "hatchling.build"
[project]
name = "metricflow"
version = "0.206.0"
description = "Translates a simple metric definition into reusable SQL and executes it against the SQL engine of your choice."
readme = "README.md"
requires-python = ">=3.8,<3.13"
license = "BUSL-1.1"
keywords = []
authors = [
{name = "dbt Labs"}
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"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",
"Programming Language :: Python :: Implementation :: PyPy",
]
# Dependencies are specified through the `hatch-requirements-txt` plug-in.
dynamic = ["dependencies", "optional-dependencies"]
[tool.hatch.metadata.hooks.requirements_txt]
files = [
"metricflow-semantics/extra-hatch-configuration/requirements.txt",
"extra-hatch-configuration/requirements.txt",
]
[project.urls]
Documentation = "https://docs.getdbt.com/docs/build/about-metricflow"
"Source Code" = "https://github.com/dbt-labs/metricflow"
[tool.hatch.metadata.hooks.requirements_txt.optional-dependencies]
dbt-bigquery = [
"dbt-metricflow/extra-hatch-configuration/requirements-dbt-bigquery.txt"
]
dbt-databricks = [
"dbt-metricflow/extra-hatch-configuration/requirements-dbt-databricks.txt"
]
dbt-duckdb = [
"dbt-metricflow/extra-hatch-configuration/requirements-dbt-duckdb.txt"
]
dbt-postgres = [
"dbt-metricflow/extra-hatch-configuration/requirements-dbt-postgres.txt"
]
dbt-redshift = [
"dbt-metricflow/extra-hatch-configuration/requirements-dbt-redshift.txt"
]
dbt-snowflake = [
"dbt-metricflow/extra-hatch-configuration/requirements-dbt-snowflake.txt"
]
dbt-trino = [
"dbt-metricflow/extra-hatch-configuration/requirements-dbt-trino.txt"
]
dev-packages = [
"metricflow-semantics/extra-hatch-configuration/requirements-dev-packages.txt",
"dbt-metricflow/extra-hatch-configuration/requirements-cli.txt"
]
trino-sql-client-packages = [
"extra-hatch-configuration/requirements-trino-sql-client-packages.txt"
]
# There are files that hatch will always include as well (e.g. the LICENSE file).
# See hatch build docs for more details.
[tool.hatch.build.targets.sdist]
packages = ["metricflow", "metricflow-semantics/metricflow_semantics"]
# include doesn't seem to work with packages, so using force include.
[tool.hatch.build.targets.sdist.force-include]
"ATTRIBUTION.md" = "ATTRIBUTION.md"
[tool.hatch.build.targets.wheel]
packages = ["metricflow", "metricflow-semantics/metricflow_semantics"]
[tool.hatch.build.targets.wheel.force-include]
"ATTRIBUTION.md" = "ATTRIBUTION.md"
# Environment setup
[tool.hatch.envs.dev-env]
description = "Environment for development. Includes a DuckDB-backed client."
run = "run-coverage --no-cov"
features = [
"dev-packages",
"dbt-duckdb",
]
[tool.hatch.envs.dev-env.env-vars]
MF_TEST_ADAPTER_TYPE="duckdb"
MF_SQL_ENGINE_URL="duckdb://"
# This allows us to use the classes in the `dbt-metricflow` package for tests without installing the package.
# `dbt-metricflow` can't be installed as it has `metricflow` as a dependency.
PYTHONPATH="metricflow-semantics:dbt-metricflow"
[tool.hatch.envs.postgres-env.env-vars]
PYTHONPATH="metricflow-semantics:dbt-metricflow"
MF_SQL_ENGINE_URL="postgresql://metricflow@localhost:5432/metricflow"
MF_SQL_ENGINE_PASSWORD="metricflowing"
MF_TEST_ADAPTER_TYPE="postgres"
[tool.hatch.envs.postgres-env]
description = "Dev environment for working with Postgres adapter"
features = [
"dev-packages",
"dbt-postgres",
]
# NOTE: All of the below should have their authentication credentials
# configured independently of the hatch env construction
[tool.hatch.envs.bigquery-env.env-vars]
PYTHONPATH="metricflow-semantics:dbt-metricflow"
MF_TEST_ADAPTER_TYPE="bigquery"
[tool.hatch.envs.bigquery-env]
description = "Dev environment for working with the BigQuery adapter"
features = [
"dev-packages",
"dbt-bigquery",
]
[tool.hatch.envs.databricks-env.env-vars]
PYTHONPATH="metricflow-semantics:dbt-metricflow"
MF_TEST_ADAPTER_TYPE="databricks"
[tool.hatch.envs.databricks-env]
description = "Dev environment for working with the Databricks adapter"
features = [
"dev-packages",
"dbt-databricks",
]
[tool.hatch.envs.redshift-env.env-vars]
PYTHONPATH="metricflow-semantics:dbt-metricflow"
MF_TEST_ADAPTER_TYPE="redshift"
[tool.hatch.envs.redshift-env]
description = "Dev environment for working with the Redshift adapter"
features = [
"dev-packages",
"dbt-redshift"
]
[tool.hatch.envs.snowflake-env.env-vars]
PYTHONPATH="metricflow-semantics:dbt-metricflow"
MF_TEST_ADAPTER_TYPE="snowflake"
[tool.hatch.envs.snowflake-env]
description = "Dev environment for working with Snowflake adapter"
features = [
"dev-packages",
"dbt-snowflake",
]
[tool.hatch.envs.trino-env.env-vars]
PYTHONPATH="metricflow-semantics:dbt-metricflow"
MF_TEST_ADAPTER_TYPE = "trino"
MF_SQL_ENGINE_URL = "trino://trino@localhost:8080/"
DBT_ENV_SECRET_CATALOG="memory"
[tool.hatch.envs.trino-env]
description = "Dev environment for working with the Trino adapter"
features = [
"dev-packages",
"trino-sql-client-packages",
"dbt-trino"
]
[tool.black]
line-length = 120
[tool.pytest.ini_options]
# Many deprecation warnings come from 3rd-party libraries and make the
# output of pytest noisy. Since no action is going to be taken, hide those
# warnings.
filterwarnings = [
"ignore::DeprecationWarning:dbt_common.*:",
"ignore::DeprecationWarning:halo.*:",
# `protobuff` issue: https://github.com/protocolbuffers/protobuf/issues/15077
# protobuff is specified by `dbt-core`
'ignore:.*Type google.*:DeprecationWarning',
]
python_functions = "test_* populate_source_schema"