Skip to content

Conversation

@emmyoop
Copy link
Member

@emmyoop emmyoop commented Nov 21, 2025

Resolves #12151

Problem

dbt-core used setuptools as its build backend while dbt-adapters and dbt-common use hatch, creating inconsistency across the dbt ecosystem. This complicated build processes, required maintaining legacy build files, and created build isolation issues (#10465) where wheels and source distributions weren't built in separate environments.

Solution

Build System Migration

  • Migrated to hatchling as the build backend with declarative configuration in pyproject.toml
  • Created custom build hook to handle LICENSE file requirements for both GitHub (repo root) and PyPI (package root)
  • Established core/dbt/__version__.py as single source of truth for versioning

Legacy Cleanup

  • Removed MANIFEST.in (package contents now defined declaratively)
  • Simplified setup.py to minimal compatibility shim for backwards compatibility
  • Updated build script to use hatch build instead of python -m build

CI/CD Updates

  • Migrated all GitHub Actions workflows to use hatch commands for setup, testing, linting, and building
  • Updated release workflows to use hatch for version management and distribution building
  • Updated version detection in release branch workflows to read from new version location

Developer Experience

  • Updated contributor documentation with hatch installation and usage instructions
  • Defined hatch environments and scripts for common development tasks (testing, linting, building)
  • Streamlined setup process with hatch run setup

Build Isolation

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

@cla-bot cla-bot bot added the cla:yes label Nov 21, 2025
@github-actions
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

❌ Patch coverage is 15.38462% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.97%. Comparing base (1219bd4) to head (f6d2070).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12192      +/-   ##
==========================================
- Coverage   91.98%   91.97%   -0.01%     
==========================================
  Files         203      205       +2     
  Lines       24965    24967       +2     
==========================================
  Hits        22964    22964              
- Misses       2001     2003       +2     
Flag Coverage Δ
integration 88.86% <15.38%> (-0.01%) ⬇️
unit 65.18% <15.38%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Unit Tests 65.18% <15.38%> (-0.01%) ⬇️
Integration Tests 88.86% <15.38%> (-0.01%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Spike] Move to hatch for build tooling

2 participants