From e08a1205af00edcc764a5e1a31e441880ec56a57 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Tue, 4 Jun 2024 12:05:02 -0700 Subject: [PATCH 1/4] /* PR_START p--py312 12 */ Move `metricflow` dependencies. Some of the dependencies listed for `metricflow` should instead be dependecies in `metricflow-semantics` or part of the dev environment. --- extra-hatch-configuration/requirements-dev-packages.txt | 2 ++ metricflow-semantics/pyproject.toml | 1 + pyproject.toml | 4 ---- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/extra-hatch-configuration/requirements-dev-packages.txt b/extra-hatch-configuration/requirements-dev-packages.txt index b0ddd88f8d..d7b81a9c61 100644 --- a/extra-hatch-configuration/requirements-dev-packages.txt +++ b/extra-hatch-configuration/requirements-dev-packages.txt @@ -4,6 +4,8 @@ pre-commit>=3.2.2, <3.3.0 pytest-mock>=3.7.0, <3.8.0 pytest-xdist>=3.2.1, <3.3.0 pytest>=7.1.1, < 7.2.0 +PyYAML>=6.0, <7.0.0 +graphviz>=0.18.2, <0.21 types-PyYAML types-python-dateutil types-tabulate diff --git a/metricflow-semantics/pyproject.toml b/metricflow-semantics/pyproject.toml index 59fb7f0468..cfaafc3163 100644 --- a/metricflow-semantics/pyproject.toml +++ b/metricflow-semantics/pyproject.toml @@ -27,6 +27,7 @@ classifiers = [ dependencies = [ "dbt-semantic-interfaces>=0.5.1, <0.6.0", + "python-dateutil>=2.8.2, <2.9.0", "rapidfuzz>=3.0, <4.0", ] diff --git a/pyproject.toml b/pyproject.toml index 8eea748e51..0f3c35e3aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,13 +27,9 @@ classifiers = [ ] dependencies = [ "Jinja2>=3.1.3", - "PyYAML>=6.0, <7.0.0", "dbt-semantic-interfaces>=0.5.1, <0.6.0", - "graphviz>=0.18.2, <0.21", "more-itertools>=8.10.0, <10.2.0", "pydantic>=1.10.0, <1.11.0", - "python-dateutil>=2.8.2, <2.9.0", - "rapidfuzz>=3.0, <4.0", "tabulate>=0.8.9", "typing_extensions>=4.4, <5.0", ] From ad5b133ad679d6e404c39179c9f8d04e3b4382b8 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Tue, 4 Jun 2024 13:39:25 -0700 Subject: [PATCH 2/4] Share requiremnts between `metricflow` and `metricflow-semantics`. --- extra-hatch-configuration/requirements.txt | 6 ++++++ .../extra-hatch-configuration/requirements.txt | 3 +++ metricflow-semantics/pyproject.toml | 12 +++++++----- pyproject.toml | 17 ++++++++--------- 4 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 extra-hatch-configuration/requirements.txt create mode 100644 metricflow-semantics/extra-hatch-configuration/requirements.txt diff --git a/extra-hatch-configuration/requirements.txt b/extra-hatch-configuration/requirements.txt new file mode 100644 index 0000000000..65237f8987 --- /dev/null +++ b/extra-hatch-configuration/requirements.txt @@ -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 diff --git a/metricflow-semantics/extra-hatch-configuration/requirements.txt b/metricflow-semantics/extra-hatch-configuration/requirements.txt new file mode 100644 index 0000000000..7b1d210bce --- /dev/null +++ b/metricflow-semantics/extra-hatch-configuration/requirements.txt @@ -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 diff --git a/metricflow-semantics/pyproject.toml b/metricflow-semantics/pyproject.toml index cfaafc3163..e3f3e19ee0 100644 --- a/metricflow-semantics/pyproject.toml +++ b/metricflow-semantics/pyproject.toml @@ -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] @@ -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] diff --git a/pyproject.toml b/pyproject.toml index 0f3c35e3aa..66a0186df0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" From b33c563134d4e11dc86bdaa5b1644e6ed0921c6e Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Tue, 4 Jun 2024 13:45:10 -0700 Subject: [PATCH 3/4] Move `dev-packages` to `metricflow-semantics`. Dependencies between `metricflow` and `metricflow-semantics` should largely be the same. --- .../requirements-dev-packages.txt | 1 + metricflow-semantics/pyproject.toml | 15 +++------------ pyproject.toml | 2 +- 3 files changed, 5 insertions(+), 13 deletions(-) rename {extra-hatch-configuration => metricflow-semantics/extra-hatch-configuration}/requirements-dev-packages.txt (93%) diff --git a/extra-hatch-configuration/requirements-dev-packages.txt b/metricflow-semantics/extra-hatch-configuration/requirements-dev-packages.txt similarity index 93% rename from extra-hatch-configuration/requirements-dev-packages.txt rename to metricflow-semantics/extra-hatch-configuration/requirements-dev-packages.txt index d7b81a9c61..8d49ed248e 100644 --- a/extra-hatch-configuration/requirements-dev-packages.txt +++ b/metricflow-semantics/extra-hatch-configuration/requirements-dev-packages.txt @@ -6,6 +6,7 @@ pytest-xdist>=3.2.1, <3.3.0 pytest>=7.1.1, < 7.2.0 PyYAML>=6.0, <7.0.0 graphviz>=0.18.2, <0.21 +tabulate>=0.8.9 types-PyYAML types-python-dateutil types-tabulate diff --git a/metricflow-semantics/pyproject.toml b/metricflow-semantics/pyproject.toml index e3f3e19ee0..dec34d0d87 100644 --- a/metricflow-semantics/pyproject.toml +++ b/metricflow-semantics/pyproject.toml @@ -26,25 +26,16 @@ classifiers = [ ] # Dependencies are specified through the `hatch-requirements-txt` plug-in. -dynamic = ["dependencies"] +dynamic = ["dependencies", "optional-dependencies"] [tool.hatch.metadata.hooks.requirements_txt] files = [ "extra-hatch-configuration/requirements.txt", ] -[project.optional-dependencies] +[tool.hatch.metadata.hooks.requirements_txt.optional-dependencies] dev-packages = [ - # Developer tools - "mypy>=1.7.0, <1.8.0", - "pre-commit>=3.2.2, <3.3.0", - "pytest-mock>=3.7.0, <3.8.0", - "pytest-xdist>=3.2.1, <3.3.0", - "pytest>=7.1.1, < 7.2.0", - "tabulate>=0.8.9", - "types-PyYAML", - "types-python-dateutil", - "types-tabulate", + "extra-hatch-configuration/requirements-dev-packages.txt", ] [tool.hatch.envs.dev-env] diff --git a/pyproject.toml b/pyproject.toml index 66a0186df0..15a04d51db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,7 +63,7 @@ dbt-trino = [ "dbt-metricflow/extra-hatch-configuration/requirements-dbt-trino.txt" ] dev-packages = [ - "extra-hatch-configuration/requirements-dev-packages.txt", + "metricflow-semantics/extra-hatch-configuration/requirements-dev-packages.txt", "dbt-metricflow/extra-hatch-configuration/requirements-cli.txt" ] sql-client-packages = [ From 9d27754a677729fbc4f16f4e00cae68261db109e Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Tue, 4 Jun 2024 18:25:40 -0700 Subject: [PATCH 4/4] Address comments. --- .../extra-hatch-configuration/requirements-dev-packages.txt | 1 - metricflow-semantics/extra-hatch-configuration/requirements.txt | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/metricflow-semantics/extra-hatch-configuration/requirements-dev-packages.txt b/metricflow-semantics/extra-hatch-configuration/requirements-dev-packages.txt index 8d49ed248e..e0819f9f06 100644 --- a/metricflow-semantics/extra-hatch-configuration/requirements-dev-packages.txt +++ b/metricflow-semantics/extra-hatch-configuration/requirements-dev-packages.txt @@ -5,7 +5,6 @@ pytest-mock>=3.7.0, <3.8.0 pytest-xdist>=3.2.1, <3.3.0 pytest>=7.1.1, < 7.2.0 PyYAML>=6.0, <7.0.0 -graphviz>=0.18.2, <0.21 tabulate>=0.8.9 types-PyYAML types-python-dateutil diff --git a/metricflow-semantics/extra-hatch-configuration/requirements.txt b/metricflow-semantics/extra-hatch-configuration/requirements.txt index 7b1d210bce..37e6118d75 100644 --- a/metricflow-semantics/extra-hatch-configuration/requirements.txt +++ b/metricflow-semantics/extra-hatch-configuration/requirements.txt @@ -1,3 +1,4 @@ dbt-semantic-interfaces>=0.5.1, <0.6.0 +graphviz>=0.18.2, <0.21 python-dateutil>=2.8.2, <2.9.0 rapidfuzz>=3.0, <4.0