summaryrefslogtreecommitdiffstats
path: root/anta/__init__.py
blob: 39732889922c210c27350c93b4c410f02b9f473b (plain)
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
# Copyright (c) 2023-2024 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the LICENSE file.
"""Arista Network Test Automation (ANTA) Framework."""
import importlib.metadata
import os

__version__ = f"v{importlib.metadata.version('anta')}"
__credits__ = [
    "Angélique Phillipps",
    "Colin MacGiollaEáin",
    "Khelil Sator",
    "Matthieu Tâche",
    "Onur Gashi",
    "Paul Lavelle",
    "Guillaume Mulocher",
    "Thomas Grimonet",
]
__copyright__ = "Copyright 2022, Arista EMEA AS"

# Global ANTA debug mode environment variable
__DEBUG__ = bool(os.environ.get("ANTA_DEBUG", "").lower() == "true")


# Source: https://rich.readthedocs.io/en/stable/appendix/colors.html
# pylint: disable=R0903
class RICH_COLOR_PALETTE:
    """Color code for text rendering."""

    ERROR = "indian_red"
    FAILURE = "bold red"
    SUCCESS = "green4"
    SKIPPED = "bold orange4"
    HEADER = "cyan"
    UNSET = "grey74"


# Dictionary to use in a Rich.Theme: custom_theme = Theme(RICH_COLOR_THEME)
RICH_COLOR_THEME = {
    "success": RICH_COLOR_PALETTE.SUCCESS,
    "skipped": RICH_COLOR_PALETTE.SKIPPED,
    "failure": RICH_COLOR_PALETTE.FAILURE,
    "error": RICH_COLOR_PALETTE.ERROR,
    "unset": RICH_COLOR_PALETTE.UNSET,
}

GITHUB_SUGGESTION = "Please reach out to the maintainer team or open an issue on Github: https://github.com/arista-netdevops-community/anta."