Skip to content

Commit

Permalink
Share requiremnts between metricflow and metricflow-semantics.
Browse files Browse the repository at this point in the history
  • Loading branch information
plypaul committed Jun 4, 2024
1 parent a40e347 commit 63fb9ae
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 22 deletions.
6 changes: 6 additions & 0 deletions extra-hatch-configuration/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Jinja2>=3.1.3
dbt-semantic-interfaces>=0.5.1, <0.6.0
more-itertools>=8.10.0, <10.2.0
pydantic>=1.10.0, <1.11.0
tabulate>=0.8.9
typing_extensions>=4.4, <5.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dbt-semantic-interfaces>=0.5.1, <0.6.0
python-dateutil>=2.8.2, <2.9.0
rapidfuzz>=3.0, <4.0
12 changes: 7 additions & 5 deletions metricflow-semantics/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling~=1.14.0"]
requires = ["hatchling~=1.14.0", "hatch-requirements-txt >= 0.4.1, <0.5.0"]
build-backend = "hatchling.build"

[project]
Expand All @@ -25,10 +25,12 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]

dependencies = [
"dbt-semantic-interfaces>=0.5.1, <0.6.0",
"python-dateutil>=2.8.2, <2.9.0",
"rapidfuzz>=3.0, <4.0",
# Dependencies are specified through the `hatch-requirements-txt` plug-in.
dynamic = ["dependencies"]

[tool.hatch.metadata.hooks.requirements_txt]
files = [
"extra-hatch-configuration/requirements.txt",
]

[project.optional-dependencies]
Expand Down
32 changes: 15 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,16 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"Jinja2>=3.1.3",
"dbt-semantic-interfaces>=0.5.1, <0.6.0",
"more-itertools>=8.10.0, <10.2.0",
"pydantic>=1.10.0, <1.11.0",
"tabulate>=0.8.9",
"typing_extensions>=4.4, <5.0",

# 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",
]

# Optional dependencies are specified through the `hatch-requirements-txt` plug-in.
dynamic = ["optional-dependencies"]

[project.urls]
Documentation = "https://docs.getdbt.com/docs/build/about-metricflow"
Expand Down Expand Up @@ -100,7 +99,6 @@ packages = ["metricflow", "metricflow-semantics/metricflow_semantics"]
[tool.hatch.envs.dev-env]
description = "Environment for development. Includes a DuckDB-backed client."
run = "run-coverage --no-cov"
dependencies = ["metricflow-semantics @ {root:uri}/metricflow-semantics"]

features = [
"dev-packages",
Expand All @@ -113,11 +111,11 @@ 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="./dbt-metricflow"
PYTHONPATH="metricflow-semantics:dbt-metricflow"


[tool.hatch.envs.postgres-env.env-vars]
PYTHONPATH="./dbt-metricflow"
PYTHONPATH="metricflow-semantics:dbt-metricflow"
MF_SQL_ENGINE_URL="postgresql://metricflow@localhost:5432/metricflow"
MF_SQL_ENGINE_PASSWORD="metricflowing"
MF_TEST_ADAPTER_TYPE="postgres"
Expand All @@ -136,7 +134,7 @@ features = [
# configured independently of the hatch env construction

[tool.hatch.envs.bigquery-env.env-vars]
PYTHONPATH="./dbt-metricflow"
PYTHONPATH="metricflow-semantics:dbt-metricflow"
MF_TEST_ADAPTER_TYPE="bigquery"

[tool.hatch.envs.bigquery-env]
Expand All @@ -150,7 +148,7 @@ features = [


[tool.hatch.envs.databricks-env.env-vars]
PYTHONPATH="./dbt-metricflow"
PYTHONPATH="metricflow-semantics:dbt-metricflow"
MF_TEST_ADAPTER_TYPE="databricks"


Expand All @@ -165,7 +163,7 @@ features = [


[tool.hatch.envs.redshift-env.env-vars]
PYTHONPATH="./dbt-metricflow"
PYTHONPATH="metricflow-semantics:dbt-metricflow"
MF_TEST_ADAPTER_TYPE="redshift"

[tool.hatch.envs.redshift-env]
Expand All @@ -179,7 +177,7 @@ features = [


[tool.hatch.envs.snowflake-env.env-vars]
PYTHONPATH="./dbt-metricflow"
PYTHONPATH="metricflow-semantics:dbt-metricflow"
MF_TEST_ADAPTER_TYPE="snowflake"

[tool.hatch.envs.snowflake-env]
Expand All @@ -193,7 +191,7 @@ features = [


[tool.hatch.envs.trino-env.env-vars]
PYTHONPATH="./dbt-metricflow"
PYTHONPATH="metricflow-semantics:dbt-metricflow"
MF_TEST_ADAPTER_TYPE = "trino"
MF_SQL_ENGINE_URL = "trino://trino@localhost:8080/"
DBT_ENV_SECRET_CATALOG="memory"
Expand Down

0 comments on commit 63fb9ae

Please sign in to comment.