{"record":{"id":"fb99a64f929a246a","repo":"dbt-labs/dbt-core","slug":"this-backend-does-not-build-sdists-use-dbt-ci-py","errorCode":null,"errorMessage":"this backend does not build sdists; use `dbt-ci pypi pack --sdist`","messagePattern":"this backend does not build sdists; use `dbt-ci pypi pack --sdist`","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"crates/dbt-ci/templates/sdist_build_backend.py","lineNumber":119,"sourceCode":"\n    digest = hashlib.sha256(data).hexdigest()\n    if digest != entry[\"sha256\"]:\n        raise RuntimeError(\n            f\"sha256 mismatch for {filename}: expected {entry['sha256']}, got {digest}\"\n        )\n\n    out = Path(wheel_directory) / filename\n    out.write_bytes(data)\n    return filename\n\n\ndef get_requires_for_build_wheel(config_settings=None):\n    return []\n\n\ndef build_sdist(sdist_directory, config_settings=None):\n    # The sdist is produced by `dbt-ci pypi pack --sdist`, not by this backend.\n    raise RuntimeError(\n        \"this backend does not build sdists; use `dbt-ci pypi pack --sdist`\"\n    )\n","sourceCodeStart":101,"sourceCodeEnd":122,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-ci/templates/sdist_build_backend.py#L101-L122","documentation":"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`.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use the project's tooling instead: `dbt-ci pypi pack --sdist` to produce the sdist","If you only need the wheel, run `python -m build --wheel` or `pip wheel .` which use build_wheel","Avoid `--no-binary` / sdist-forcing flags when installing this package","Update packaging scripts to call dbt-ci for sdist production"],"exampleFix":"# before\npython -m build --sdist\n# after\ndbt-ci pypi pack --sdist","handlingStrategy":"try-catch","validationCode":"import subprocess\n# build only the wheel, which this backend supports\nsubprocess.run([\"python\", \"-m\", \"build\", \"--wheel\"], check=True)","typeGuard":null,"tryCatchPattern":"try:\n    subprocess.run([\"python\", \"-m\", \"build\", \"--sdist\"], check=True)\nexcept RuntimeError as e:\n    if 'does not build sdists' in str(e):\n        subprocess.run([\"dbt-ci\", \"pypi\", \"pack\", \"--sdist\"], check=True)\n    else:\n        raise","preventionTips":["Always use `dbt-ci pypi pack --sdist` to produce sdists for this project","Use `python -m build --wheel` (not plain `python -m build`) when you only need the wheel","Avoid `--no-binary` install flags that force backend sdist/wheel builds from source","Document the sdist workflow for contributors to prevent manual build attempts"],"tags":["packaging","pep517","build-backend","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}