diff --git a/.github/ISSUE_TEMPLATE/implementation-ticket.yml b/.github/ISSUE_TEMPLATE/implementation-ticket.yml index 9bc709e9..18b24046 100644 --- a/.github/ISSUE_TEMPLATE/implementation-ticket.yml +++ b/.github/ISSUE_TEMPLATE/implementation-ticket.yml @@ -30,6 +30,16 @@ body: What is the definition of done for this ticket? Include any relevant edge cases and/or test cases validations: required: true + - type: textarea + attributes: + label: Suggested Tests + description: | + Provide scenarios to test. Link to existing similar tests if appropriate. + placeholder: | + 1. Test with no version specified in the schema file and use selection logic on a versioned model for a specific version. Expect pass. + 2. Test with a version specified in the schema file that is no valid. Expect ParsingError. + validations: + required: true - type: textarea attributes: label: Impact to Other Teams diff --git a/.github/ISSUE_TEMPLATE/slash-command-template.md b/.github/ISSUE_TEMPLATE/slash-command-template.md new file mode 100644 index 00000000..059b2498 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/slash-command-template.md @@ -0,0 +1,23 @@ +## Short description + + + +## Acceptance criteria + + + +## Suggested Tests + + + +## Impact to Other Teams + + + +## Will backports be required? + + + +## Context + + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 642f6cdc..035240f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.11' diff --git a/.github/workflows/ci_code_quality.yml b/.github/workflows/ci_code_quality.yml index 42db857d..b8b33314 100644 --- a/.github/workflows/ci_code_quality.yml +++ b/.github/workflows/ci_code_quality.yml @@ -41,7 +41,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.11' diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 46efdf70..87550594 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -46,7 +46,7 @@ jobs: uses: actions/checkout@v4 - name: "Set up Python ${{ matrix.python-version }}" - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} diff --git a/README.md b/README.md index ccfafb42..48490856 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ -** replace `dbt-common` with your repository name in all docs - ## Understanding dbt-common -A short description of the purpose of this repository. Include relevant images. +The shared common utilities for dbt-core and adapter implementations use ## Getting started diff --git a/dbt_common/__about__.py b/dbt_common/__about__.py new file mode 100644 index 00000000..9f7a875c --- /dev/null +++ b/dbt_common/__about__.py @@ -0,0 +1 @@ +version = "0.1.0" diff --git a/docs/arch/adr-0001-build-tooling.md b/docs/arch/adr-0001-build-tooling.md new file mode 100644 index 00000000..0db3f162 --- /dev/null +++ b/docs/arch/adr-0001-build-tooling.md @@ -0,0 +1,80 @@ +# 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 dbt-core & 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 (but is officially part of the larger PyPA working group) +- 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 + +#### 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` +- [+] 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 diff --git a/pyproject.toml b/pyproject.toml index 4a54150c..7c84afe3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "dbt-common" -version = "0.0.1" +dynamic = ["version"] description = "The shared common utilities that dbt-core and adapter implementations use" readme = "README.md" requires-python = ">=3.8" @@ -33,6 +33,9 @@ dependencies = [ "typing-extensions~=4.4", ] +[tool.hatch.version] +path = "dbt_common/__about__.py" + [build-system] requires = ["hatchling"] build-backend = "hatchling.build"