File size: 782 Bytes
71687cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Detect archspec name."""

from __future__ import annotations

from typing import TYPE_CHECKING

from ...auxlib import NULL
from .. import hookimpl
from ..types import CondaVirtualPackage

if TYPE_CHECKING:
    from collections.abc import Iterable


def archspec_build():
    from ...core.index import get_archspec_name

    build_num = get_archspec_name()
    return build_num or NULL


@hookimpl
def conda_virtual_packages() -> Iterable[CondaVirtualPackage]:
    # 1: __archspec==1=BUILD
    yield CondaVirtualPackage(
        name="archspec",
        version="1",
        build=archspec_build,
        override_entity="build",
        # empty_override=NULL,  # falsy override → skip __archspec
    )