"""Retired arbitrary-code upload client.

Remote Python source delivery is forbidden. Signed OTA releases are the only
supported software-delivery path.
"""

from __future__ import annotations


LEGACY_CODE_UPLOAD_DISABLED_MESSAGE = (
    "Remote Python code upload is retired: use signed OTA releases"
)


class LegacyCodeUploadDisabledError(RuntimeError):
    """Raised when a caller attempts to use the old code-upload endpoint."""


def upload_code_to_django(code_str: str):
    """Reject arbitrary code upload without network or file side effects."""

    del code_str
    raise LegacyCodeUploadDisabledError(LEGACY_CODE_UPLOAD_DISABLED_MESSAGE)
