• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vantage6 / vantage6 / 16647357834

31 Jul 2025 11:09AM UTC coverage: 25.481%. First build
16647357834

Pull #2201

github

web-flow
Merge b88debe1f into a00194c07
Pull Request #2201: Update to python 3.13

15 of 28 new or added lines in 9 files covered. (53.57%)

172 of 675 relevant lines covered (25.48%)

0.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.08
/vantage6/vantage6/cli/context/algorithm_store.py
1
from __future__ import annotations
1✔
2

3
from vantage6.common.globals import APPNAME, InstanceType
1✔
4

5
from vantage6.cli._version import __version__
1✔
6
from vantage6.cli.configuration_manager import ServerConfigurationManager
1✔
7
from vantage6.cli.context.base_server import BaseServerContext
1✔
8
from vantage6.cli.globals import (
1✔
9
    DEFAULT_SERVER_SYSTEM_FOLDERS as S_FOL,
10
    AlgoStoreGlobals,
11
    ServerType,
12
)
13

14

15
class AlgorithmStoreContext(BaseServerContext):
1✔
16
    """
1✔
17
    A context class for the algorithm store server.
18

19
    Parameters
20
    ----------
21
    instance_name : str
22
        Name of the configuration instance, corresponds to the filename
23
        of the configuration file.
24
    system_folders : bool, optional
25
        System wide or user configuration, by default S_FOL
26
    """
27

28
    INST_CONFIG_MANAGER = ServerConfigurationManager
1✔
29

30
    def __init__(self, instance_name: str, system_folders: bool = S_FOL):
1✔
31
        super().__init__(
×
32
            InstanceType.ALGORITHM_STORE,
33
            instance_name,
34
            system_folders=system_folders,
35
        )
36
        self.log.info("vantage6 version '%s'", __version__)
×
37

38
    def get_database_uri(self) -> str:
1✔
39
        """
40
        Obtain the database uri from the environment or the configuration.
41

42
        Returns
43
        -------
44
        str
45
            string representation of the database uri
46
        """
NEW
47
        return super().get_database_uri(AlgoStoreGlobals.DB_URI_ENV_VAR.value)
×
48

49
    @property
1✔
50
    def docker_container_name(self) -> str:
1✔
51
        """
52
        Name of the docker container that the server is running in.
53

54
        Returns
55
        -------
56
        str
57
            Server's docker container name
58
        """
NEW
59
        return f"{APPNAME}-{self.name}-{self.scope}-{ServerType.ALGORITHM_STORE}"
×
60

61
    @classmethod
1✔
62
    def from_external_config_file(
1✔
63
        cls, path: str, system_folders: bool = S_FOL
64
    ) -> AlgorithmStoreContext:
65
        """
66
        Create a server context from an external configuration file. External
67
        means that the configuration file is not located in the default folders
68
        but its location is specified by the user.
69

70
        Parameters
71
        ----------
72
        path : str
73
            Path of the configuration file
74
        system_folders : bool, optional
75
            System wide or user configuration, by default S_FOL
76

77
        Returns
78
        -------
79
        AlgorithmStoreContext
80
            Server context object
81
        """
82
        return super().from_external_config_file(
×
83
            path,
84
            ServerType.ALGORITHM_STORE,
85
            AlgoStoreGlobals.CONFIG_NAME_ENV_VAR.value,
86
            system_folders,
87
        )
88

89
    @classmethod
1✔
90
    def config_exists(cls, instance_name: str, system_folders: bool = S_FOL) -> bool:
1✔
91
        """
92
        Check if a configuration file exists.
93

94
        Parameters
95
        ----------
96
        instance_name : str
97
            Name of the configuration instance, corresponds to the filename
98
            of the configuration file.
99
        system_folders : bool, optional
100
            System wide or user configuration, by default S_FOL
101

102
        Returns
103
        -------
104
        bool
105
            Whether the configuration file exists or not
106
        """
107
        return super().config_exists(
×
108
            InstanceType.ALGORITHM_STORE, instance_name, system_folders
109
        )
110

111
    @classmethod
1✔
112
    def available_configurations(
1✔
113
        cls, system_folders: bool = S_FOL
114
    ) -> tuple[list, list]:
115
        """
116
        Find all available server configurations in the default folders.
117

118
        Parameters
119
        ----------
120
        system_folders : bool, optional
121
            System wide or user configuration, by default S_FOL
122

123
        Returns
124
        -------
125
        tuple[list, list]
126
            The first list contains validated configuration files, the second
127
            list contains invalid configuration files.
128
        """
129
        return super().available_configurations(
×
130
            InstanceType.ALGORITHM_STORE, system_folders
131
        )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc