From ce5733d88acde005686f099ea2288366f95a05d8 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Tue, 16 Jan 2024 08:26:28 -0600 Subject: [PATCH 1/4] add adr --- docs/arch/adr-0001-build-tooling.md | 78 +++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 docs/arch/adr-0001-build-tooling.md diff --git a/docs/arch/adr-0001-build-tooling.md b/docs/arch/adr-0001-build-tooling.md new file mode 100644 index 00000000..d8037df5 --- /dev/null +++ b/docs/arch/adr-0001-build-tooling.md @@ -0,0 +1,78 @@ +# Build Tool + + +## Context + +We need to select a build tool for managing dependencies for, building, and distributing `dbt-common`. While tooling can vary, this repo can serve as an OSS template for other OSS at dbt Labs and beyond. + + +## Options + +- `setuptools` (`twine`, `build`) +- `hatch` +- `poetry` + + +### setuptools + +#### Pro's + +- most popular option +- supported by Python Packaging Authority +- build tool of record for existing internal adapters + +#### Con's + +- less flexible; forced to support backwards compatibility more so than other options +- no dependency management (manually add to `pyproject.toml`) + + +### hatch + +#### Pro's + +- supported by Python Packaging Authority +- already used by `dbt-semantic-layer` and `internal-actions` +- supports running tests against multiple versions of python locally (same functionality as `tox`) +- supports configuring workflows in `pyproject.toml` (same functionality as `make`) +- incorporates new PEP's quickly +- Manages python distributions itself without need of pyenv. This allows Windows and non-Windows users to both work locally in the same way. +- used by black, tox, pipx, Jupyter Notebook, Datadog + +#### Con's + +- far less popular than other options +- no dependency management (manually add to `pyproject.toml`) +- only one maintainer +- Hatch does not allow for the installation of specific patch release versions but rather only uses minor release granularity that tracks the latest patch release + + +### poetry + +#### Pro's + +- second most popular option, similar in popularity to `setuptools` +- dependency management (`poetry add "my-dependency"`) +- provides a lock file +- more than one maintainer + +#### Con's + +- incorporates new PEP's slowly + + +## Decision + +#### Selected: `hatch` + +This option aligns with `dbt-adapter` and `dbt-semantic-layer`, which minimizes confusion +for anyone working in multiple repositories. +`hatch` also replaces `tox` and `make`, which consolidates our toolset to make working locally and with CI more consistant. + + +## Consequences + +- [+] retire `tox` +- [+] retire `make` +- [-] write more detailed docs given lower familiarity +- [-] learning curve From a71591e505a15b9d785fe09432dbf4df1afe01cb Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Tue, 16 Jan 2024 12:00:00 -0600 Subject: [PATCH 2/4] expand on single maintainer --- docs/arch/adr-0001-build-tooling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/arch/adr-0001-build-tooling.md b/docs/arch/adr-0001-build-tooling.md index d8037df5..52d34426 100644 --- a/docs/arch/adr-0001-build-tooling.md +++ b/docs/arch/adr-0001-build-tooling.md @@ -43,7 +43,7 @@ We need to select a build tool for managing dependencies for, building, and dist - far less popular than other options - no dependency management (manually add to `pyproject.toml`) -- only one maintainer +- only one maintainer (but is part of the larger PyPA working group) - Hatch does not allow for the installation of specific patch release versions but rather only uses minor release granularity that tracks the latest patch release From fe18edd536d4f5cf108f2553cea54cc00cbc3708 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Thu, 18 Jan 2024 09:29:41 -0600 Subject: [PATCH 3/4] wording tweaks --- docs/arch/adr-0001-build-tooling.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/arch/adr-0001-build-tooling.md b/docs/arch/adr-0001-build-tooling.md index 52d34426..c0b8e480 100644 --- a/docs/arch/adr-0001-build-tooling.md +++ b/docs/arch/adr-0001-build-tooling.md @@ -19,7 +19,7 @@ We need to select a build tool for managing dependencies for, building, and dist - most popular option - supported by Python Packaging Authority -- build tool of record for existing internal adapters +- build tool of record for dbt-core & existing internal adapters #### Con's @@ -43,7 +43,7 @@ We need to select a build tool for managing dependencies for, building, and dist - far less popular than other options - no dependency management (manually add to `pyproject.toml`) -- only one maintainer (but is part of the larger PyPA working group) +- only one maintainer (but is officially part of the larger PyPA working group) - Hatch does not allow for the installation of specific patch release versions but rather only uses minor release granularity that tracks the latest patch release @@ -74,5 +74,7 @@ for anyone working in multiple repositories. - [+] retire `tox` - [+] retire `make` +- [+] rewriting the release workflows will create a more intuitive release for hatch projects +- [-] we cannot reuse the existing release workflows - [-] write more detailed docs given lower familiarity - [-] learning curve From 6c5b81a10659303e47d4fa3cdf34639ae665786c Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Thu, 18 Jan 2024 12:39:59 -0600 Subject: [PATCH 4/4] Update docs/arch/adr-0001-build-tooling.md --- docs/arch/adr-0001-build-tooling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/arch/adr-0001-build-tooling.md b/docs/arch/adr-0001-build-tooling.md index c0b8e480..0db3f162 100644 --- a/docs/arch/adr-0001-build-tooling.md +++ b/docs/arch/adr-0001-build-tooling.md @@ -44,7 +44,7 @@ We need to select a build tool for managing dependencies for, building, and dist - far less popular than other options - no dependency management (manually add to `pyproject.toml`) - only one maintainer (but is officially part of the larger PyPA working group) -- Hatch does not allow for the installation of specific patch release versions but rather only uses minor release granularity that tracks the latest patch release +- Hatch does not allow for the installation of specific patch release versions of itself but rather only uses minor release granularity that tracks the latest patch release ### poetry