{"record":{"id":"2f1fc319f3666967","repo":"crewAIInc/crewAI","slug":"project-build-failed-please-ensure-that-the-comma","errorCode":null,"errorMessage":"Project build failed. Please ensure that the command `uv build --sdist` completes successfully.","messagePattern":"Project build failed\\. Please ensure that the command `uv build --sdist` completes successfully\\.","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"lib/cli/src/crewai_cli/tools/main.py","lineNumber":178,"sourceCode":"            pass\n\n        with tempfile.TemporaryDirectory() as temp_build_dir:\n            subprocess.run(  # noqa: S603\n                [\"uv\", \"build\", \"--sdist\", \"--out-dir\", temp_build_dir],  # noqa: S607\n                check=True,\n                capture_output=False,\n                env=build_env,\n            )\n\n            tarball_filename = next(\n                (f for f in os.listdir(temp_build_dir) if f.endswith(\".tar.gz\")), None\n            )\n            if not tarball_filename:\n                console.print(\n                    \"Project build failed. Please ensure that the command `uv build --sdist` completes successfully.\",\n                    style=\"bold red\",\n                )\n                raise SystemExit(1)\n\n            tarball_path = os.path.join(temp_build_dir, tarball_filename)\n            with open(tarball_path, \"rb\") as file:\n                tarball_contents = file.read()\n\n            encoded_tarball = base64.b64encode(tarball_contents).decode(\"utf-8\")\n\n        console.print(\"[bold blue]Publishing tool to repository...[/bold blue]\")\n        publish_response = self.plus_api_client.publish_tool(\n            handle=project_name,\n            is_public=is_public,\n            version=project_version,\n            description=project_description,\n            encoded_file=f\"data:application/x-gzip;base64,{encoded_tarball}\",\n            available_exports=available_exports,\n            tools_metadata=tools_metadata,\n        )\n","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/cli/src/crewai_cli/tools/main.py#L160-L196","documentation":"Printed with SystemExit(1) by ToolCommand.publish() when, after running `uv build --sdist` in a temp build dir, no *.tar.gz file is found in the output directory. It means the sdist build produced no artifact — typically because the build itself failed or the project's build configuration (pyproject.toml) is broken, invalid, or the package would be empty.","triggerScenarios":"Running `crewai tool publish` on a project whose pyproject.toml is malformed, has no [build-system]/hatchling config, excludes all files from the sdist, lacks a README referenced in metadata, or where `uv build --sdist` fails on version/spec errors (the output is streamed with capture_output=False so the uv errors appear above this message).","commonSituations":"Tool project scaffolded manually instead of via `crewai tool create`; pyproject.toml referencing a missing readme/license file; name/version fields missing or not PEP 508 compliant; uv not present or an old uv version that fails silently.","solutions":["Reproduce the build directly to see the real error: `uv build --sdist` in the project root.","Fix pyproject.toml: valid name, version, [build-system] with hatchling, and existing files referenced in metadata (readme, license).","If the project was not scaffolded as a tool, regenerate with `crewai tool create <handle>` and port your code in.","Upgrade uv (`pip install -U uv` / `uv self update`) so modern sdist targets are supported."],"exampleFix":"# before (pyproject.toml missing build backend)\n[project]\nname = \"my-tool\"\nversion = \"0.1.0\"\n\n# after\n[build-system]\nrequires = [\"hatchling\"]\nbuild-backend = \"hatchling.build\"\n\n[project]\nname = \"my-tool\"\nversion = \"0.1.0\"\nreadme = \"README.md\"","handlingStrategy":"validation","validationCode":"import subprocess, pathlib\ndef sdist_builds(project_dir: str) -> bool:\n    r = subprocess.run([\"uv\", \"build\", \"--sdist\"], cwd=project_dir,\n                       capture_output=True, text=True)\n    if r.returncode != 0:\n        print(r.stderr)\n        return False\n    return any(p.suffix == \".gz\" for p in pathlib.Path(project_dir, \"dist\").glob(\"*.tar.gz\"))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run `uv build --sdist` locally before publishing","Scaffold tool projects with `crewai tool create` so build config is correct","Keep pyproject.toml metadata (readme/license paths) pointing at real files"],"tags":["crewai","cli","publish","build","uv","packaging"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}