{"record":{"id":"ec0fa61cb3543062","repo":"AlexsJones/llmfit","slug":"unknown-version-version-r","errorCode":null,"errorMessage":"Unknown version: {version!r}","messagePattern":"Unknown version: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"llmfit-python/hatch_build.py","lineNumber":193,"sourceCode":"        if py_target not in TARGET_CONFIGS:\n            raise ValueError(\n                f\"Unknown LLMFIT_PYTHON_PLATFORM_TAG={py_target!r}. Must be one of: {sorted(TARGET_CONFIGS)}\",\n            )\n\n        upstream_target, binary_name = TARGET_CONFIGS[py_target]\n        pypi_version: str = self.metadata.version\n\n        print(f\"  target={upstream_target}  version={pypi_version}  wheel tag=py3-none-{py_target}\")\n\n        llmfit_root = Path(self.root).parent\n        if version == \"editable\":\n            # For editable installs, look for target/debug/llmfit or target/release/llmfit (or llmfit.exe on Windows).\n            bin_path = self._find_local_binary(llmfit_root)\n        elif version == \"standard\":\n            # For release installs, look for e.g. target/x86_64-unknown-linux-gnu/release/llmfit on Linux.\n            bin_path = self._find_binary_for_target(llmfit_root, py_target)\n        else:\n            raise ValueError(f\"Unknown version: {version!r}\")\n\n        # Always check that the binary exists.\n        if not bin_path.is_file():\n            raise FileNotFoundError(\n                f\"Binary not found at {bin_path}. The binary selection logic selected a file that does not exist.\",\n            )\n\n        # If possible, check the self-reported version of the binary.\n        # If the binary was built for a different platform then it's not possible.\n        if py_target == running_platform:\n            self._check_binary_version(bin_path, pypi_version)\n\n        # Place the binary in the wheel's scripts directory so that the\n        # installer puts it in .venv/bin/ (or Scripts/ on Windows).\n        build_data[\"shared_scripts\"][str(bin_path.absolute())] = binary_name\n\n        # Override the platform tag so the wheel gets the correct platform-specific name.\n        build_data[\"tag\"] = f\"py3-none-{py_target}\"","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/AlexsJones/llmfit/blob/acc7e40c3a0afbd36510a92f2f8f3d5177cfc0fe/llmfit-python/hatch_build.py#L175-L211","documentation":"Raised in initialize() when the `version` string Hatchling passes to the build hook is neither 'editable' nor 'standard'. Hatchling currently only uses those two build modes for this hook, so this ValueError is a defensive guard against future Hatchling API changes or manual/unsupported invocations of the hook with a different mode.","triggerScenarios":"Upgrading Hatchling to a version that introduces a new build mode string passed to hook initialize(); calling the hook directly in tests or tooling with an arbitrary version argument; a fork renaming build modes in pyproject.toml hatch configuration.","commonSituations":"Unpinned hatchling dependency drifting in a lockfile refresh; custom build tooling that drives BuildHookInterface manually.","solutions":["Pin hatchling to a known-good version in pyproject.toml / the lockfile (e.g. hatchling==1.x that passes 'standard'/'editable')","If a new mode is legitimate, extend the if/elif in initialize() to handle it (or map it to the standard path) instead of raising","For manual tooling, invoke the hook with version='standard' or 'editable' exactly as Hatchling does"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import hatchling\nfrom packaging.version import Version\nif Version(hatchling.__version__) > Version(\"1.26\"):\n    # untested hatchling may pass a new build mode to initialize()\n    print(\"warning: hatchling newer than tested; build mode contract may differ\")","typeGuard":"def is_supported_build_mode(version: str) -> bool:\n    \"\"\"True when the hatchling build mode is one this hook implements.\"\"\"\n    return version in (\"editable\", \"standard\")","tryCatchPattern":"try:\n    hook.initialize(version, build_data)\nexcept ValueError as e:\n    raise SystemExit(f\"unsupported build mode {version!r} — pin a compatible hatchling\")","preventionTips":["Pin hatchling to a tested version range in pyproject.toml","Run the packaging test suite (make -C llmfit-python check) after any hatchling upgrade","Watch hatchling release notes for build-hook interface changes"],"tags":["python","hatch","build-hook","api-drift"],"backgroundTag":"unsupported-build-mode","analyzedSha":"acc7e40c3a0afbd36510a92f2f8f3d5177cfc0fe","analyzedAt":"2026-08-17T10:35:29.658Z","contentChangedAt":"2026-08-17T10:35:29.658Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}