# ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========

from typing import ClassVar

from mirage.runtime.language import LanguageRuntime
from mirage.runtime.types import Language


class PythonRuntime(LanguageRuntime):
    """The python tier: every runtime that interprets Python source.

    Groups the engines behind the python3/python commands (monty,
    wasi, local here; pyodide in TypeScript), so ``language`` and the
    default ``captures`` are declared once and python-tier behavior
    has one home. A new Python engine subclasses this, not
    LanguageRuntime.
    """

    language: ClassVar[Language] = "python"
    captures = ("python3", "python")
    # Whether `python3 -m mod` can run at all. True for every engine
    # that is real CPython, since runpy does the work; False for an
    # engine implementing a subset of the language with no import
    # system to find a module with. A capability of the tier, declared
    # here rather than probed, so a refusal can name the runtime.
    runs_modules: ClassVar[bool] = True
