-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathconstants.py
68 lines (52 loc) · 1.79 KB
/
constants.py
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""This module defines constants that are used in the version, docker build and new commands"""
from dataclasses import dataclass
from getpass import getuser
from pathlib import Path
@dataclass(frozen=True, init=False)
class Constants: # pylint: disable=too-many-instance-attributes
"""Defines constants for the he-toolkit"""
# version and the docker's tags
user: str = getuser()
version: str = "2.1.0"
base_label: str = f"{user}/ubuntu_he_base:{version}"
toolkit_label: str = f"{user}/ubuntu_he_toolkit:{version}"
vscode_label: str = f"{user}/ubuntu_he_vscode:{version}"
custom_label: str = f"{user}/ubuntu_he_%s:{version}"
# python version
python_version_tuple = (3, 10)
python_version_string = "3.10"
# cmake properties
cmake_min_version: str = "3.22"
cmake_cxx_standard: str = "17"
# Root directory
HEKIT_ROOT_DIR: Path = Path(__file__).resolve().parent.parent.parent
# Docker directory
HEKIT_DOCKER_DIR: Path = Path(__file__).resolve().parent.parent.parent / "docker"
# hekit core commands
HEKIT_COMMANDS = {
"check-dependencies",
"docker-build",
"init",
"install",
"build",
"fetch",
"list",
"new",
"plugins",
"remove",
"algebras",
"gen-primes",
}
@dataclass(frozen=True, init=False)
class PluginState:
"""Define the possible state of a plugin"""
ENABLE: str = "enabled"
DISABLE: str = "disabled"
@dataclass(frozen=True, init=False)
class PluginsConfig:
"""Define the attributes of the config file for plugins"""
ROOT_DIR: Path = Path("~/.hekit/plugins/").expanduser()
FILE: Path = ROOT_DIR / "plugins.toml"
KEY: str = "plugins"