-
Notifications
You must be signed in to change notification settings - Fork 97
/
pyproject.toml
179 lines (140 loc) · 5.62 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
[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.207.0.dev2"
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.9,<3.13"
license = "BUSL-1.1"
keywords = []
authors = [
{name = "dbt Labs"}
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"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"
# 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"
dependencies = [
# Developer tools
"mypy>=1.7.0, <1.8.0",
"pre-commit>=3.2.2, <3.3.0",
"pytest-mock>=3.14.0, <3.15.0",
"pytest-xdist>=3.6.0, <3.7.0",
"pytest>=8.0.0, < 9.0.0",
"PyYAML>=6.0, <7.0.0",
"tabulate>=0.8.9",
"types-PyYAML",
"types-python-dateutil",
"types-tabulate",
# CLI-related
"halo>=0.0.31, <0.1.0",
"update-checker>=0.18.0, <0.19.0",
# Bug with mypy: https://github.com/pallets/click/issues/2558#issuecomment-1656546003
"click>=8.1.6",
"dbt-core @ git+https://github.com/dbt-labs/dbt-core@ff6745c79532d50139d553f3b088c5d783b4f2dd#subdirectory=core",
"dbt-duckdb>=1.8.0, <1.9.0",
]
[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"
template = "dev-env"
extra-dependencies = ["dbt-postgres>=1.8.0, <1.9.0"]
## NOTE: All environments 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"
template = "dev-env"
extra-dependencies = ["dbt-bigquery>=1.8.0, <1.9.0"]
[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"
template = "dev-env"
# Needed as dbt-databricks 1.8.1 depends on dbt-core~=1.8.0 while this uses dbt-core 1.9.0a1
pre-install-commands = [
"pip install 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"
template = "dev-env"
extra-dependencies = ["dbt-redshift>=1.8.0, <1.9.0"]
[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"
template = "dev-env"
extra-dependencies = ["dbt-snowflake>=1.8.0, <1.9.0"]
[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"
template = "dev-env"
extra-dependencies = ["trino>=0.328.0, <0.329.0", "dbt-trino>=1.8.0, <1.9.0"]
[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"