Skip to content

Errors

DeploymentNotFoundError

Bases: Exception

Source code in lume_services/errors.py
 93
 94
 95
 96
 97
 98
 99
100
101
102
class DeploymentNotFoundError(Exception):
    def __init__(self, query: dict) -> None:
        """
        Args:
            query (dict): Dictionary representation of mongodb query.

        """
        self.query = query
        self.message = "Deployment not found for query: %s."
        super().__init__(self.message, str(self.query))

__init__(query)

Parameters:

Name Type Description Default
query dict

Dictionary representation of mongodb query.

required
Source code in lume_services/errors.py
 94
 95
 96
 97
 98
 99
100
101
102
def __init__(self, query: dict) -> None:
    """
    Args:
        query (dict): Dictionary representation of mongodb query.

    """
    self.query = query
    self.message = "Deployment not found for query: %s."
    super().__init__(self.message, str(self.query))

DeploymentNotRegisteredError

Bases: Exception

DeploymentNotRegisteredError indicates that a deployment was not found for the given model. If no deployment_id is passed, assumes that the user is attempting to load the latest deployment for that model.

Source code in lume_services/errors.py
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
class DeploymentNotRegisteredError(Exception):
    """DeploymentNotRegisteredError indicates that a deployment was not found for the
    given model. If no deployment_id is passed, assumes that the user is attempting to
    load the latest deployment for that model.

    """

    def __init__(self, model_id: int, deployment_id: Optional[int] = None) -> None:
        """
        Args:
            model_id (int): ID of model.
            deployment_id (Optional[int]): Deployment ID that was attempted to retrieve.
        """
        self.model_id = model_id
        self.deployment_id = deployment_id
        if deployment_id is None:
            self.message = "No deployment registered for model_id=%s."
            super().__init__(self.message, self.model_id)
        else:
            self.message = (
                "Deployment not found for model_id = %s with deploymend_id=%s"
            )
            super().__init__(self.message, self.model_id, self.deployment_id)

__init__(model_id, deployment_id=None)

Parameters:

Name Type Description Default
model_id int

ID of model.

required
deployment_id Optional[int]

Deployment ID that was attempted to retrieve.

None
Source code in lume_services/errors.py
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
def __init__(self, model_id: int, deployment_id: Optional[int] = None) -> None:
    """
    Args:
        model_id (int): ID of model.
        deployment_id (Optional[int]): Deployment ID that was attempted to retrieve.
    """
    self.model_id = model_id
    self.deployment_id = deployment_id
    if deployment_id is None:
        self.message = "No deployment registered for model_id=%s."
        super().__init__(self.message, self.model_id)
    else:
        self.message = (
            "Deployment not found for model_id = %s with deploymend_id=%s"
        )
        super().__init__(self.message, self.model_id, self.deployment_id)

EmptyResultError

Bases: Exception

Error raised when a result is empty.

Source code in lume_services/errors.py
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
class EmptyResultError(Exception):
    """Error raised when a result is empty."""

    def __init__(
        self, flow_id: str, flow_run_id: str, task_slug: Optional[str] = None
    ) -> None:
        """
        Args:
            flow_id (str): ID of the flow.s
            flow_run_id (str): ID of the flow run.
            task_slug (Optional[str]): Prefect tasks are assigned slugs. The task
                slug is the identifier for the task for which we're trying to load the
                result.

        """
        self.flow_id = flow_id
        self.flow_run_id = flow_run_id
        self.task_slug = task_slug
        if not self.task_slug:
            self.message = (
                "Task with slug: %s for flow run: %s of flow_id: %s has no result."
            )
            super().__init__(
                self.message, self.task_slug, self.flow_run_id, self.flow_id
            )

        else:
            self.message = "Flow run: %s of flow_id: %s has no result."
            super().__init__(self.message, self.flow_run_id, flow_id)

__init__(flow_id, flow_run_id, task_slug=None)

Parameters:

Name Type Description Default
flow_id str

ID of the flow.s

required
flow_run_id str

ID of the flow run.

required
task_slug Optional[str]

Prefect tasks are assigned slugs. The task slug is the identifier for the task for which we're trying to load the result.

None
Source code in lume_services/errors.py
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
def __init__(
    self, flow_id: str, flow_run_id: str, task_slug: Optional[str] = None
) -> None:
    """
    Args:
        flow_id (str): ID of the flow.s
        flow_run_id (str): ID of the flow run.
        task_slug (Optional[str]): Prefect tasks are assigned slugs. The task
            slug is the identifier for the task for which we're trying to load the
            result.

    """
    self.flow_id = flow_id
    self.flow_run_id = flow_run_id
    self.task_slug = task_slug
    if not self.task_slug:
        self.message = (
            "Task with slug: %s for flow run: %s of flow_id: %s has no result."
        )
        super().__init__(
            self.message, self.task_slug, self.flow_run_id, self.flow_id
        )

    else:
        self.message = "Flow run: %s of flow_id: %s has no result."
        super().__init__(self.message, self.flow_run_id, flow_id)

EnvironmentNotConfiguredError

Bases: Exception

Error used to mark an unconfigured environment.

Source code in lume_services/errors.py
 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
class EnvironmentNotConfiguredError(Exception):
    """Error used to mark an unconfigured environment."""

    def __init__(
        self, env_vars: Dict[str, str], validation_error: ValidationError = None
    ) -> None:
        """
        Args:
            env_vars (Dict[str, str]): Dictionary mapping service to list of
                environment variables used to configure that service.
            validation_error (ValidationError): ValidationError raised by Pydantic
                class during assignment.

        """

        self.env = dict(os.environ)
        self.env_vars = []

        for service in env_vars:
            self.env_vars += env_vars[service]

        self.missing_vars = [var for var in self.env_vars if var not in self.env]

        if validation_error is None:
            self.message = "Environment variables not defined: %s."
            super().__init__(self.message, ", ".join(self.missing_vars))

        else:
            self.message = "%s. Evironment variables not defined: %s"
            super().__init__(
                self.message, str(validation_error), ", ".join(self.missing_vars)
            )

__init__(env_vars, validation_error=None)

Parameters:

Name Type Description Default
env_vars Dict[str, str]

Dictionary mapping service to list of environment variables used to configure that service.

required
validation_error ValidationError

ValidationError raised by Pydantic class during assignment.

None
Source code in lume_services/errors.py
 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
def __init__(
    self, env_vars: Dict[str, str], validation_error: ValidationError = None
) -> None:
    """
    Args:
        env_vars (Dict[str, str]): Dictionary mapping service to list of
            environment variables used to configure that service.
        validation_error (ValidationError): ValidationError raised by Pydantic
            class during assignment.

    """

    self.env = dict(os.environ)
    self.env_vars = []

    for service in env_vars:
        self.env_vars += env_vars[service]

    self.missing_vars = [var for var in self.env_vars if var not in self.env]

    if validation_error is None:
        self.message = "Environment variables not defined: %s."
        super().__init__(self.message, ", ".join(self.missing_vars))

    else:
        self.message = "%s. Evironment variables not defined: %s"
        super().__init__(
            self.message, str(validation_error), ", ".join(self.missing_vars)
        )

FlowFailedError

Bases: Exception

Error raised when a flow fails to execute successfully.

Source code in lume_services/errors.py
175
176
177
178
179
180
181
182
183
184
185
186
187
class FlowFailedError(Exception):
    """Error raised when a flow fails to execute successfully."""

    def __init__(
        self, flow_id: str, flow_run_id: str, exception_message: str = None
    ) -> None:
        self.flow_id = flow_id
        self.flow_run_id = flow_run_id
        self.exception_message = exception_message
        self.message = "Flow run: %s failed for flow_id: %s. %s"
        super().__init__(
            self.message, self.flow_run_id, self.flow_id, self.exception_message
        )

FlowNotFoundError

Bases: Exception

Source code in lume_services/errors.py
43
44
45
46
47
48
49
50
51
52
53
class FlowNotFoundError(Exception):
    def __init__(self, query: dict) -> None:
        """
        Args:
            query (dict): Dictionary representation of mongodb query.

        """

        self.query = query
        self.message = "Flow not found for query: %s."
        super().__init__(self.message, self.query)

__init__(query)

Parameters:

Name Type Description Default
query dict

Dictionary representation of mongodb query.

required
Source code in lume_services/errors.py
44
45
46
47
48
49
50
51
52
53
def __init__(self, query: dict) -> None:
    """
    Args:
        query (dict): Dictionary representation of mongodb query.

    """

    self.query = query
    self.message = "Flow not found for query: %s."
    super().__init__(self.message, self.query)

FlowOfFlowsNotFoundError

Bases: Exception

Source code in lume_services/errors.py
56
57
58
59
60
61
62
63
64
65
class FlowOfFlowsNotFoundError(Exception):
    def __init__(self, query: dict) -> None:
        """
        Args:
            query (dict): Dictionary representation of mongodb query.

        """
        self.query = query
        self.message = "Flow not found for query: %s."
        super().__init__(self.message, self.query)

__init__(query)

Parameters:

Name Type Description Default
query dict

Dictionary representation of mongodb query.

required
Source code in lume_services/errors.py
57
58
59
60
61
62
63
64
65
def __init__(self, query: dict) -> None:
    """
    Args:
        query (dict): Dictionary representation of mongodb query.

    """
    self.query = query
    self.message = "Flow not found for query: %s."
    super().__init__(self.message, self.query)

LocalBackendError

Bases: Exception

LocalBackendError indicates that a server-backend operation has been executed against the LocalBackend. Server-backend operations include flow registration and remote execution.

Source code in lume_services/errors.py
221
222
223
224
225
226
227
228
229
230
class LocalBackendError(Exception):
    """LocalBackendError indicates that a server-backend operation has been executed
    against the LocalBackend. Server-backend operations include flow registration and
    remote execution.

    """

    def __init__(self):
        self.message = "Cannot run server-backend operation using LocalBackend."
        super().__init__(self.message)

MissingEnvironmentYamlError

Bases: Exception

Error raised when a model package directory is missing an environment.yml spec.

Source code in lume_services/errors.py
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
class MissingEnvironmentYamlError(Exception):
    """Error raised when a model package directory is missing an environment.yml
    spec.

    """

    def __init__(self, directory: str):
        """
        Args:
            directory (str): Local directory holding the package source.

        """
        self.directory = directory
        self.message = "Poorly formed package at %s. No Environment yaml provided."

        super().__init__(self.message, self.directory)

__init__(directory)

Parameters:

Name Type Description Default
directory str

Local directory holding the package source.

required
Source code in lume_services/errors.py
367
368
369
370
371
372
373
374
375
376
def __init__(self, directory: str):
    """
    Args:
        directory (str): Local directory holding the package source.

    """
    self.directory = directory
    self.message = "Poorly formed package at %s. No Environment yaml provided."

    super().__init__(self.message, self.directory)

ModelNotFoundError

Bases: Exception

Source code in lume_services/errors.py
81
82
83
84
85
86
87
88
89
90
class ModelNotFoundError(Exception):
    def __init__(self, query: dict) -> None:
        """
        Args:
            query (dict): Dictionary representation of mongodb query.

        """
        self.query = query
        self.message = "Model not found for query: %s."
        super().__init__(self.message, self.query)

__init__(query)

Parameters:

Name Type Description Default
query dict

Dictionary representation of mongodb query.

required
Source code in lume_services/errors.py
82
83
84
85
86
87
88
89
90
def __init__(self, query: dict) -> None:
    """
    Args:
        query (dict): Dictionary representation of mongodb query.

    """
    self.query = query
    self.message = "Model not found for query: %s."
    super().__init__(self.message, self.query)

NoCondaEnvironmentFoundError

Bases: Exception

Error raised when CONDA_PREFIX is not defined.

Source code in lume_services/errors.py
379
380
381
382
383
class NoCondaEnvironmentFoundError(Exception):
    """Error raised when CONDA_PREFIX is not defined."""

    def __init__(self) -> None:
        super().__init__("CONDA_PREFIX environment variabe is not set.")

NoFlowFoundInPackageError

Bases: Exception

Error raised when flow not found at a given entrypoint.

Source code in lume_services/errors.py
386
387
388
389
390
391
392
393
394
395
396
397
class NoFlowFoundInPackageError(Exception):
    """Error raised when flow not found at a given entrypoint."""

    def __init__(self, source_path: str):
        """
        Args:
            source_path (str): Import path of the flow provided to entrypoint.

        """
        self.source_path = source_path
        self.message = "No flow entrypoint found for the distribution at %s"
        super().__init__(self.message, self.source_path)

__init__(source_path)

Parameters:

Name Type Description Default
source_path str

Import path of the flow provided to entrypoint.

required
Source code in lume_services/errors.py
389
390
391
392
393
394
395
396
397
def __init__(self, source_path: str):
    """
    Args:
        source_path (str): Import path of the flow provided to entrypoint.

    """
    self.source_path = source_path
    self.message = "No flow entrypoint found for the distribution at %s"
    super().__init__(self.message, self.source_path)

NoPackagesToInstallError

Bases: Exception

Error indicates no packages were returned from environment resolution.

Source code in lume_services/errors.py
277
278
279
280
281
282
class NoPackagesToInstallError(Exception):
    """Error indicates no packages were returned from environment resolution."""

    def __init__(self) -> None:
        self.message = "No packages were returned from environment resolution."
        super().__init__(self.message)

ParentFlowNotInFlowsError

Bases: Exception

Error raised when composing flow-of-flows when the parent flow is not found in the list of flows.

Source code in lume_services/errors.py
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
class ParentFlowNotInFlowsError(Exception):
    """Error raised when composing flow-of-flows when the parent flow is not found
    in the list of flows.

    """

    def __init__(self, flow_name: str, flows: List[str]):
        """
        Args:
            flow_name (str): Name of parent flow
            flows (List[str]): List of flows provided

        """
        self.flow_name = flow_name
        self.flows = flows
        self.message = "Parent flow %s not in flows: %s"
        super().__init__(self.message, self.flow_name, ", ".join(self.flows))

__init__(flow_name, flows)

Parameters:

Name Type Description Default
flow_name str

Name of parent flow

required
flows List[str]

List of flows provided

required
Source code in lume_services/errors.py
122
123
124
125
126
127
128
129
130
131
132
def __init__(self, flow_name: str, flows: List[str]):
    """
    Args:
        flow_name (str): Name of parent flow
        flows (List[str]): List of flows provided

    """
    self.flow_name = flow_name
    self.flows = flows
    self.message = "Parent flow %s not in flows: %s"
    super().__init__(self.message, self.flow_name, ", ".join(self.flows))

PathNotInMount

Bases: Exception

Error raised when the path provided does not exist in a mounted filesystem.

Source code in lume_services/errors.py
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
class PathNotInMount(Exception):
    """Error raised when the path provided does not exist in a mounted filesystem."""

    def __init__(
        self, filesystem_identifier: str, path: str, mount_path: str, mount_alias: str
    ) -> None:
        """
        Args:
            filesystem_identifier (str): Identifier of the filesystem to use.
            path (str): Path that was not found.
            mount_path (str): Original path of the mounted directory on host.
            mount_alias (str): Alias used in mount the filesystem.
        """
        self.filesystem_identifier = filesystem_identifier
        self.path = (path,)
        self.mount_path = mount_path
        self.mount_alias = mount_alias
        self.message = "Path %s not in mount for mounted filesystem identifier: %s, \
            Mount path: %s, Mount alias: %s"
        super().__init__(
            self.message,
            self.path,
            self.filesystem_identifier,
            self.mount_path,
            self.mount_alias,
        )

__init__(filesystem_identifier, path, mount_path, mount_alias)

Parameters:

Name Type Description Default
filesystem_identifier str

Identifier of the filesystem to use.

required
path str

Path that was not found.

required
mount_path str

Original path of the mounted directory on host.

required
mount_alias str

Alias used in mount the filesystem.

required
Source code in lume_services/errors.py
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
def __init__(
    self, filesystem_identifier: str, path: str, mount_path: str, mount_alias: str
) -> None:
    """
    Args:
        filesystem_identifier (str): Identifier of the filesystem to use.
        path (str): Path that was not found.
        mount_path (str): Original path of the mounted directory on host.
        mount_alias (str): Alias used in mount the filesystem.
    """
    self.filesystem_identifier = filesystem_identifier
    self.path = (path,)
    self.mount_path = mount_path
    self.mount_alias = mount_alias
    self.message = "Path %s not in mount for mounted filesystem identifier: %s, \
        Mount path: %s, Mount alias: %s"
    super().__init__(
        self.message,
        self.path,
        self.filesystem_identifier,
        self.mount_path,
        self.mount_alias,
    )

ProjectNotFoundError

Bases: Exception

Source code in lume_services/errors.py
68
69
70
71
72
73
74
75
76
77
78
class ProjectNotFoundError(Exception):
    def __init__(self, query: dict) -> None:
        """
        Args:
            query (dict): Dictionary representation of mongodb query.


        """
        self.query = query
        self.message = "Project not found for query: %s."
        super().__init__(self.message, self.query)

__init__(query)

Parameters:

Name Type Description Default
query dict

Dictionary representation of mongodb query.

required
Source code in lume_services/errors.py
69
70
71
72
73
74
75
76
77
78
def __init__(self, query: dict) -> None:
    """
    Args:
        query (dict): Dictionary representation of mongodb query.


    """
    self.query = query
    self.message = "Project not found for query: %s."
    super().__init__(self.message, self.query)

TaskNotCompletedError

Bases: Exception

Error raised when a task fails to execute successfully.

Source code in lume_services/errors.py
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
class TaskNotCompletedError(Exception):
    """Error raised when a task fails to execute successfully."""

    def __init__(self, task_slug: str, flow_id: str, flow_run_id: str) -> None:
        """
        Args:
            task_slug (str): Slug of the task that was not completed.
            flow_id (str): ID of Prefect flow.
            flow_run_id (str): ID of Prefect Flow run.
        """
        self.flow_id = flow_id
        self.flow_run_id = flow_run_id
        self.task_slug = task_slug
        self.message = (
            "Task with slug: %s not completed for flow_run_id: %s, flow_id: %s."
        )
        super().__init__(self.message, self.task_slug, self.flow_run_id, self.flow_id)

__init__(task_slug, flow_id, flow_run_id)

Parameters:

Name Type Description Default
task_slug str

Slug of the task that was not completed.

required
flow_id str

ID of Prefect flow.

required
flow_run_id str

ID of Prefect Flow run.

required
Source code in lume_services/errors.py
159
160
161
162
163
164
165
166
167
168
169
170
171
172
def __init__(self, task_slug: str, flow_id: str, flow_run_id: str) -> None:
    """
    Args:
        task_slug (str): Slug of the task that was not completed.
        flow_id (str): ID of Prefect flow.
        flow_run_id (str): ID of Prefect Flow run.
    """
    self.flow_id = flow_id
    self.flow_run_id = flow_run_id
    self.task_slug = task_slug
    self.message = (
        "Task with slug: %s not completed for flow_run_id: %s, flow_id: %s."
    )
    super().__init__(self.message, self.task_slug, self.flow_run_id, self.flow_id)

TaskNotInFlowError

Bases: Exception

Error raised to indicate that the given task is not in a flow.

Source code in lume_services/errors.py
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
class TaskNotInFlowError(Exception):
    """Error raised to indicate that the given task is not in a flow."""

    def __init__(self, flow_name: str, project_name: str, task_name: str) -> None:
        """
        Args:
            flow_name (str): Name of flow
            project_name (str): Name of project
            task_name (str): Name of task

        """

        self.flow_name = flow_name
        self.task_name = task_name
        self.project_name = project_name
        self.message = "Task %s not in flow %s."
        super().__init__(
            self.message, self.task_name, self.project_name, self.flow_name
        )

__init__(flow_name, project_name, task_name)

Parameters:

Name Type Description Default
flow_name str

Name of flow

required
project_name str

Name of project

required
task_name str

Name of task

required
Source code in lume_services/errors.py
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
def __init__(self, flow_name: str, project_name: str, task_name: str) -> None:
    """
    Args:
        flow_name (str): Name of flow
        project_name (str): Name of project
        task_name (str): Name of task

    """

    self.flow_name = flow_name
    self.task_name = task_name
    self.project_name = project_name
    self.message = "Task %s not in flow %s."
    super().__init__(
        self.message, self.task_name, self.project_name, self.flow_name
    )

UnableToIndexLocalChannelError

Bases: Exception

Error raised when unable to index the local channel during conda environment resolution to local channel.

Source code in lume_services/errors.py
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
class UnableToIndexLocalChannelError(Exception):
    """Error raised when unable to index the local channel during conda environment
    resolution to local channel.

    """

    def __init__(
        self, local_channel_directory: str, return_code: int, output: str
    ) -> None:
        """
        Args:
            local_channel_directory (str): Directory holding local channel.
            return_code (int): Return code of the subprocess.
            output (str): Output of the subprocess.


        """
        self.local_channel_directory = local_channel_directory
        self.return_code = return_code
        self.output = output

        self.message = "Unable to index local channel at %s. Subprocess returned \
            code %s with output: %s"
        super().__init__(
            self.message, self.local_channel_directory, self.return_code, self.output
        )

__init__(local_channel_directory, return_code, output)

Parameters:

Name Type Description Default
local_channel_directory str

Directory holding local channel.

required
return_code int

Return code of the subprocess.

required
output str

Output of the subprocess.

required
Source code in lume_services/errors.py
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
def __init__(
    self, local_channel_directory: str, return_code: int, output: str
) -> None:
    """
    Args:
        local_channel_directory (str): Directory holding local channel.
        return_code (int): Return code of the subprocess.
        output (str): Output of the subprocess.


    """
    self.local_channel_directory = local_channel_directory
    self.return_code = return_code
    self.output = output

    self.message = "Unable to index local channel at %s. Subprocess returned \
        code %s with output: %s"
    super().__init__(
        self.message, self.local_channel_directory, self.return_code, self.output
    )

UnableToInstallCondaDependenciesError

Bases: Exception

Error indicating that certain conda dependencies were not installed during resolution.

Source code in lume_services/errors.py
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
class UnableToInstallCondaDependenciesError(Exception):
    """Error indicating that certain conda dependencies were not installed during
    resolution.

    """

    def __init__(self, conda_dependencies: List[str]) -> None:
        """
        Args:
            conda_dependencies (List[str]): List of conda dependencies that were not
                installed.
        """
        self.deps = conda_dependencies

        self.message = "Unable to install conda dependencies: %s"
        super().__init__(self.message, ", ".join(self.deps))

__init__(conda_dependencies)

Parameters:

Name Type Description Default
conda_dependencies List[str]

List of conda dependencies that were not installed.

required
Source code in lume_services/errors.py
291
292
293
294
295
296
297
298
299
300
def __init__(self, conda_dependencies: List[str]) -> None:
    """
    Args:
        conda_dependencies (List[str]): List of conda dependencies that were not
            installed.
    """
    self.deps = conda_dependencies

    self.message = "Unable to install conda dependencies: %s"
    super().__init__(self.message, ", ".join(self.deps))

UnableToInstallPipDependenciesError

Bases: Exception

Error indicating failed pip installation.

Source code in lume_services/errors.py
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
class UnableToInstallPipDependenciesError(Exception):
    """Error indicating failed pip installation."""

    def __init__(
        self,
        pip_dependencies: List[str],
        python_version: float,
        platform: Literal["linux-64", "linux-32", "osx-64", "win-32", "win-64"],
        e: Exception,
    ) -> None:
        """

        Args:
            pip_dependencies (List[str]): List of dependencies to be installed with pip
            python_version (float): Python version used for installation
            platform (Literal["linux-64", "linux-32", "osx-64", "win-32", "win-64"]):
                Platform used for installation
            e (Exception): Exception raised from installation subprocess


        """
        self.deps = pip_dependencies
        self.python_version = python_version
        self.platform = platform

        self.message = "Unable to install pip dependencies: %s for python=%s on \
            platform=%s with error: %s"
        super().__init__(self.message, ", ".join(self.deps), self.python_version, e)

__init__(pip_dependencies, python_version, platform, e)

Parameters:

Name Type Description Default
pip_dependencies List[str]

List of dependencies to be installed with pip

required
python_version float

Python version used for installation

required
platform Literal['linux-64', 'linux-32', 'osx-64', 'win-32', 'win-64']

Platform used for installation

required
e Exception

Exception raised from installation subprocess

required
Source code in lume_services/errors.py
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
def __init__(
    self,
    pip_dependencies: List[str],
    python_version: float,
    platform: Literal["linux-64", "linux-32", "osx-64", "win-32", "win-64"],
    e: Exception,
) -> None:
    """

    Args:
        pip_dependencies (List[str]): List of dependencies to be installed with pip
        python_version (float): Python version used for installation
        platform (Literal["linux-64", "linux-32", "osx-64", "win-32", "win-64"]):
            Platform used for installation
        e (Exception): Exception raised from installation subprocess


    """
    self.deps = pip_dependencies
    self.python_version = python_version
    self.platform = platform

    self.message = "Unable to install pip dependencies: %s for python=%s on \
        platform=%s with error: %s"
    super().__init__(self.message, ", ".join(self.deps), self.python_version, e)

WritePermissionError

Bases: Exception

Error indicates missing write permission on a directory.

Source code in lume_services/errors.py
261
262
263
264
265
266
267
268
269
270
271
272
273
274
class WritePermissionError(Exception):
    """Error indicates missing write permission on a directory."""

    def __init__(self, directory: str) -> None:
        """
        Args:
            directory (str): Directory that is missing write permissions.

        """
        self.directory = directory
        self.user = os.getlogin()
        self.message = "User %s does not have write permissions for directory %s."

        super().__init__(self.message, self.user, self.directory)

__init__(directory)

Parameters:

Name Type Description Default
directory str

Directory that is missing write permissions.

required
Source code in lume_services/errors.py
264
265
266
267
268
269
270
271
272
273
274
def __init__(self, directory: str) -> None:
    """
    Args:
        directory (str): Directory that is missing write permissions.

    """
    self.directory = directory
    self.user = os.getlogin()
    self.message = "User %s does not have write permissions for directory %s."

    super().__init__(self.message, self.user, self.directory)