dbt-labs/dbt-core · error · RuntimeError

this backend does not build sdists; use `dbt-ci pypi pack --

Error message

this backend does not build sdists; use `dbt-ci pypi pack --sdist`

What it means

This build backend is deliberately download-only: it implements `build_wheel` (fetch a prebuilt wheel) but not sdist construction. If a tool invokes PEP 517 `build_sdist` on it (e.g. someone runs `python -m build --sdist` or `pip install` with no matching wheel, forcing an sdist build), the backend raises RuntimeError pointing at the correct command, `dbt-ci pypi pack --sdist`.

Source

Thrown at crates/dbt-ci/templates/sdist_build_backend.py:119

    digest = hashlib.sha256(data).hexdigest()
    if digest != entry["sha256"]:
        raise RuntimeError(
            f"sha256 mismatch for {filename}: expected {entry['sha256']}, got {digest}"
        )

    out = Path(wheel_directory) / filename
    out.write_bytes(data)
    return filename


def get_requires_for_build_wheel(config_settings=None):
    return []


def build_sdist(sdist_directory, config_settings=None):
    # The sdist is produced by `dbt-ci pypi pack --sdist`, not by this backend.
    raise RuntimeError(
        "this backend does not build sdists; use `dbt-ci pypi pack --sdist`"
    )

View on GitHub (pinned to 0267ce9170)

Solutions

  1. Use the project's tooling instead: `dbt-ci pypi pack --sdist` to produce the sdist
  2. If you only need the wheel, run `python -m build --wheel` or `pip wheel .` which use build_wheel
  3. Avoid `--no-binary` / sdist-forcing flags when installing this package
  4. Update packaging scripts to call dbt-ci for sdist production

Example fix

# before
python -m build --sdist
# after
dbt-ci pypi pack --sdist
Defensive patterns

Strategy: try-catch

Validate before calling

import subprocess
# build only the wheel, which this backend supports
subprocess.run(["python", "-m", "build", "--wheel"], check=True)

Try / catch

try:
    subprocess.run(["python", "-m", "build", "--sdist"], check=True)
except RuntimeError as e:
    if 'does not build sdists' in str(e):
        subprocess.run(["dbt-ci", "pypi", "pack", "--sdist"], check=True)
    else:
        raise

Prevention

When it happens

Trigger: Any tool calls `build_sdist(sdist_directory, config_settings)` on this backend: running `python -m build --sdist`, `pip wheel`/`pip download` with `--no-binary` forcing source builds, or packaging tooling that probes backend capabilities by calling build_sdist.

Common situations: A maintainer tries to build the sdist manually with `python -m build --sdist` instead of the CI tool; a contributor runs `python -m build` (which builds sdist then wheel); CI pipelines that always build sdists from source.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07). Data as JSON: /api/errors/fb99a64f929a246a. Report an issue: GitHub.