-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathenvironment.py
More file actions
45 lines (33 loc) · 1.16 KB
/
environment.py
File metadata and controls
45 lines (33 loc) · 1.16 KB
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
from typing import Dict, List, Optional, Any
from pydantic import BaseModel, Field
from dof._src.models import package
# TODO: delete this
class CondaEnvironmentSpec(BaseModel):
"""Input conda environment.yaml spec"""
name: Optional[str]
channels: List[str]
dependencies: List[str]
variables: Optional[Dict[str, str]] = Field(default={})
class EnvironmentMetadata(BaseModel):
"""Metadata for an environment"""
spec_version: str = "0.0.1"
platform: str
build_hash: str
channels: List[str]
conda_settings: Optional[Dict[str, Any]] = Field(default={})
class EnvironmentSpec(BaseModel):
"""Specifies a locked environment
A lock exists for each platform. So to fully represent a locked environment
across multiple platforms you will need multiple EnvironmentSpecs.
"""
metadata: EnvironmentMetadata
packages: List[package.Package]
env_vars: Optional[Dict[str, str]] = None
class EnvironmentCheckpoint(BaseModel):
"""An environment at a point in time
Only applys to a particular environment spec
"""
environment: EnvironmentSpec
timestamp: str
uuid: str
tags: List[str]