mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
457 sites carried an upstream prefix into every surface a user reaches — shell exports, docs, CI, the SDK. CODEX_ is not our name and it was never going to stop arriving on its own: it is what upstream writes, and every sync brings more. Two namespaces, because they answer different questions. DEV_* the app's own configuration — DEV_HOME, DEV_PROFILE, the rest HANZO_API_KEY a credential for the Hanzo stack, which is not app config CODEX_API_KEY held the literal string "CODEX_API_KEY", so the rename moves the value and not just the constant. It becomes HANZO_API_KEY, which is what create_hanzo_provider already reads through HANZO_MACHINE_ENV_KEYS — one name for one credential instead of two spellings of it. vendor/ is untouched, which is the point of vendor/: upstream code keeps upstream names, and the boundary is a path rather than a habit.
31 lines
930 B
Python
31 lines
930 B
Python
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
|
|
|
|
|
def _platform_tag() -> str:
|
|
from packaging.tags import sys_tags
|
|
|
|
return next(iter(sys_tags())).platform
|
|
|
|
|
|
class RuntimeBuildHook(BuildHookInterface):
|
|
def initialize(self, version: str, build_data: dict[str, object]) -> None:
|
|
del version
|
|
if self.target_name == "sdist":
|
|
raise RuntimeError(
|
|
"openai-codex-cli-bin is wheel-only; build and publish platform wheels only."
|
|
)
|
|
|
|
platform_tag = self.config.get("platform-tag") or os.environ.get(
|
|
"DEV_CLI_BIN_PLATFORM_TAG"
|
|
)
|
|
if not isinstance(platform_tag, str) or not platform_tag:
|
|
platform_tag = _platform_tag()
|
|
|
|
build_data["pure_python"] = False
|
|
build_data["infer_tag"] = False
|
|
build_data["tag"] = f"py3-none-{platform_tag}"
|