Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ADR for build tool #27

Merged
merged 4 commits into from
Jan 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions docs/arch/adr-0001-build-tooling.md
Original file line number Diff line number Diff line change
@@ -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
emmyoop marked this conversation as resolved.
Show resolved Hide resolved

#### 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
emmyoop marked this conversation as resolved.
Show resolved Hide resolved


### 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`
emmyoop marked this conversation as resolved.
Show resolved Hide resolved
- [-] write more detailed docs given lower familiarity
- [-] learning curve