Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ first_value = 1

[bumpversion:part:nightly]

[bumpversion:file:core/pyproject.toml]
[bumpversion:file:core/dbt/__version__.py]
search = version = "{current_version}"
replace = version = "{new_version}"
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20251121-140515.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: Switch hatchling for build tooling.
time: 2025-11-21T14:05:15.838252-05:00
custom:
Author: emmyoop
Issue: "12151"
11 changes: 5 additions & 6 deletions .github/workflows/cut-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,15 @@ jobs:

- name: "Install Python Dependencies"
run: |
python -m venv env
source env/bin/activate
python -m pip install --upgrade pip
python -m pip install hatch bumpversion

- name: "Bump Version To ${{ needs.cleanup_changelog.outputs.next-version }}"
run: |
source env/bin/activate
python -m pip install -r dev-requirements.txt
env/bin/bumpversion --allow-dirty --new-version ${{ needs.cleanup_changelog.outputs.next-version }} major
git status
cd core
hatch run setup
bumpversion --allow-dirty --new-version ${{ needs.cleanup_changelog.outputs.next-version }} major
dbt --version

- name: "Commit Version Bump to Branch"
run: |
Expand Down
64 changes: 26 additions & 38 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,19 @@ jobs:
run: |
python -m pip install --user --upgrade pip
python -m pip --version
make dev
make dev_req
mypy --version
dbt --version
python -m pip install hatch
cd core
hatch run setup

- name: Verify dbt installation
run: |
cd core
hatch run dbt --version

- name: Run pre-commit hooks
run: pre-commit run --all-files --show-diff-on-failure
run: |
cd core
hatch run code-quality

unit:
name: unit test / python ${{ matrix.python-version }}
Expand Down Expand Up @@ -95,15 +101,15 @@ jobs:
run: |
python -m pip install --user --upgrade pip
python -m pip --version
python -m pip install tox
tox --version
python -m pip install hatch
hatch --version

- name: Run unit tests
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: tox -e unit
command: cd core && hatch run ci:unit-tests

- name: Get current date
if: always()
Expand Down Expand Up @@ -219,15 +225,16 @@ jobs:
run: |
python -m pip install --user --upgrade pip
python -m pip --version
python -m pip install tox
tox --version
python -m pip install hatch
hatch --version

- name: Run integration tests
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: tox -- --ddtrace
shell: bash
command: cd core && hatch run ci:integration-tests -- --ddtrace
env:
PYTEST_ADDOPTS: ${{ format('--splits {0} --group {1}', env.PYTHON_INTEGRATION_TEST_WORKERS, matrix.split-group) }}

Expand Down Expand Up @@ -302,15 +309,16 @@ jobs:
run: |
python -m pip install --user --upgrade pip
python -m pip --version
python -m pip install tox
tox --version
python -m pip install hatch
hatch --version

- name: Run integration tests
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: tox -- --ddtrace
shell: bash
command: cd core && hatch run ci:integration-tests -- --ddtrace
env:
PYTEST_ADDOPTS: ${{ format('--splits {0} --group {1}', env.PYTHON_INTEGRATION_TEST_WORKERS, matrix.split-group) }}

Expand Down Expand Up @@ -369,7 +377,7 @@ jobs:
- name: Install python dependencies
run: |
python -m pip install --user --upgrade pip
python -m pip install --upgrade setuptools wheel twine check-wheel-contents
python -m pip install --upgrade hatch twine check-wheel-contents
python -m pip --version

- name: Build distributions
Expand All @@ -378,27 +386,7 @@ jobs:
- name: Show distributions
run: ls -lh dist/

- name: Check distribution descriptions
run: |
twine check dist/*

- name: Check wheel contents
run: |
check-wheel-contents dist/*.whl --ignore W007,W008

- name: Install wheel distributions
run: |
find ./dist/*.whl -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/

- name: Check wheel distributions
run: |
dbt --version

- name: Install source distributions
# ignore dbt-1.0.0, which intentionally raises an error when installed from source
run: |
find ./dist/*.gz -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/

- name: Check source distributions
- name: Check and verify distributions
run: |
dbt --version
cd core
hatch run build:check-all
26 changes: 4 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ jobs:
job-setup:
name: Log Inputs
runs-on: ${{ vars.UBUNTU_LATEST }}
outputs:
starting_sha: ${{ steps.set_sha.outputs.starting_sha }}
steps:
- name: "[DEBUG] Print Variables"
run: |
Expand All @@ -88,20 +86,6 @@ jobs:
echo Nightly release: ${{ inputs.nightly_release }}
echo Only Docker: ${{ inputs.only_docker }}

- name: "Checkout target branch"
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4
with:
ref: ${{ inputs.target_branch }}

# release-prep.yml really shouldn't take in the sha but since core + all adapters
# depend on it now this workaround lets us not input it manually with risk of error.
# The changes always get merged into the head so we can't use a specific commit for
# releases anyways.
- name: "Capture sha"
id: set_sha
run: |
echo "starting_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT

bump-version-generate-changelog:
name: Bump package version, Generate changelog
needs: [job-setup]
Expand All @@ -110,12 +94,13 @@ jobs:
uses: dbt-labs/dbt-release/.github/workflows/release-prep.yml@main

with:
sha: ${{ needs.job-setup.outputs.starting_sha }}
version_number: ${{ inputs.version_number }}
hatch_directory: "core"
target_branch: ${{ inputs.target_branch }}
env_setup_script_path: "scripts/env-setup.sh"
test_run: ${{ inputs.test_run }}
nightly_release: ${{ inputs.nightly_release }}
use_hatch: true

secrets: inherit

Expand Down Expand Up @@ -143,16 +128,13 @@ jobs:
with:
sha: ${{ needs.bump-version-generate-changelog.outputs.final_sha }}
version_number: ${{ inputs.version_number }}
hatch_directory: "core"
changelog_path: ${{ needs.bump-version-generate-changelog.outputs.changelog_path }}
build_script_path: "scripts/build-dist.sh"
s3_bucket_name: "core-team-artifacts"
package_test_command: "dbt --version"
test_run: ${{ inputs.test_run }}
nightly_release: ${{ inputs.nightly_release }}

secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
use_hatch: true

github-release:
name: GitHub Release
Expand Down
22 changes: 10 additions & 12 deletions .github/workflows/schema-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
target_branch:
description: "The branch to check against"
type: string
default: 'main'
default: "main"
required: true

# no special access is needed
Expand All @@ -48,8 +48,8 @@ jobs:
- name: Checkout dbt repo
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4
with:
path: ${{ env.DBT_REPO_DIRECTORY }}
ref: ${{ inputs.target_branch }}
path: ${{ env.DBT_REPO_DIRECTORY }}
ref: ${{ inputs.target_branch }}

- name: Check for changes in core/dbt/artifacts
# https://github.com/marketplace/actions/paths-changes-filter
Expand All @@ -72,18 +72,16 @@ jobs:
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4
with:
repository: dbt-labs/schemas.getdbt.com
ref: 'main'
ref: "main"
path: ${{ env.SCHEMA_REPO_DIRECTORY }}

- name: Generate current schema
if: steps.check_artifact_changes.outputs.artifacts_changed == 'true'
run: |
cd ${{ env.DBT_REPO_DIRECTORY }}
python3 -m venv env
source env/bin/activate
pip install --upgrade pip
pip install -r dev-requirements.txt -r editable-requirements.txt
python scripts/collect-artifact-schema.py --path ${{ env.LATEST_SCHEMA_PATH }}
cd ${{ env.DBT_REPO_DIRECTORY }}/core
pip install --upgrade pip hatch
hatch run setup
hatch run json-schema -- --path ${{ env.LATEST_SCHEMA_PATH }}

# Copy generated schema files into the schemas.getdbt.com repo
# Do a git diff to find any changes
Expand All @@ -99,5 +97,5 @@ jobs:
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # actions/upload-artifact@v4
if: ${{ failure() && steps.check_artifact_changes.outputs.artifacts_changed == 'true' }}
with:
name: 'schema_changes.txt'
path: '${{ env.SCHEMA_DIFF_ARTIFACT }}'
name: "schema_changes.txt"
path: "${{ env.SCHEMA_DIFF_ARTIFACT }}"
6 changes: 3 additions & 3 deletions .github/workflows/structured-logging-schema-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ jobs:
run: |
pip install --user --upgrade pip
pip --version
pip install tox
tox --version
pip install hatch
hatch --version

- name: Run postgres setup script
run: |
Expand All @@ -123,7 +123,7 @@ jobs:
with:
timeout_minutes: 30
max_attempts: 3
command: tox -e integration -- -nauto
command: cd core && hatch run ci:integration-tests -- -nauto
env:
PYTEST_ADDOPTS: ${{ format('--splits {0} --group {1}', env.PYTHON_INTEGRATION_TEST_WORKERS, matrix.split-group) }}

Expand Down
41 changes: 24 additions & 17 deletions .github/workflows/test-repeater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to check out'
description: "Branch to check out"
type: string
required: true
default: 'main'
default: "main"
test_path:
description: 'Path to single test to run (ex: tests/functional/retry/test_retry.py::TestRetry::test_fail_fast)'
description: "Path to single test to run (ex: tests/functional/retry/test_retry.py::TestRetry::test_fail_fast)"
type: string
required: true
default: 'tests/functional/...'
default: "tests/functional/..."
python_version:
description: 'Version of Python to Test Against'
description: "Version of Python to Test Against"
type: choice
options:
- '3.10'
- '3.11'
- "3.10"
- "3.11"
os:
description: 'OS to run test in'
description: "OS to run test in"
type: choice
options:
- 'ubuntu-latest'
- 'macos-14'
- 'windows-latest'
- "ubuntu-latest"
- "macos-14"
- "windows-latest"
num_runs_per_batch:
description: 'Max number of times to run the test per batch. We always run 10 batches.'
description: "Max number of times to run the test per batch. We always run 10 batches."
type: number
required: true
default: '50'
default: "50"

permissions: read-all

Expand Down Expand Up @@ -90,12 +90,19 @@ jobs:
with:
python-version: "${{ inputs.python_version }}"

- name: "Install hatch"
run: python -m pip install --user --upgrade pip hatch

- name: "Setup Dev Environment"
run: make dev
run: |
cd core
hatch run setup

- name: "Set up postgres (linux)"
if: inputs.os == '${{ vars.UBUNTU_LATEST }}'
run: make setup-db
run: |
cd core
hatch run setup-db

# mac and windows don't use make due to limitations with docker with those runners in GitHub
- name: Set up postgres (macos)
Expand Down Expand Up @@ -153,5 +160,5 @@ jobs:
- name: "Error for Failures"
if: ${{ steps.pytest.outputs.failure }}
run: |
echo "Batch ${{ matrix.batch }} failed ${{ steps.pytest.outputs.failure }} of ${{ inputs.num_runs_per_batch }} tests"
exit 1
echo "Batch ${{ matrix.batch }} failed ${{ steps.pytest.outputs.failure }} of ${{ inputs.num_runs_per_batch }} tests"
exit 1
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ build/
!core/dbt/docs/build
develop-eggs/
dist/
dist-*/
downloads/
eggs/
.eggs/
Expand All @@ -31,6 +32,8 @@ var/
logs/
.user.yml
profiles.yml
# Build-generated LICENSE file
core/LICENSE

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -95,6 +98,7 @@ target/
# pycharm
.idea/
venv/
.venv*/

# AWS credentials
.aws/
Expand Down
Loading
Loading