-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose_unit.py
More file actions
26 lines (20 loc) · 980 Bytes
/
compose_unit.py
File metadata and controls
26 lines (20 loc) · 980 Bytes
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
from abc import ABC, abstractmethod
class ComposeUnit(ABC):
"""An abstract base class representing the base for a Python Compose Unit."""
@abstractmethod
def create(self) -> None:
"""Function for creating a virtual environment."""
raise NotImplementedError("This is an abstract method!")
@abstractmethod
def install_requirements(self) -> None:
"""Function to install any and all requirements for running a script in the virtual
environment."""
raise NotImplementedError("This is an abstract method!")
@abstractmethod
def start(self) -> None:
"""Function to start a script in the previously created virtual environment."""
raise NotImplementedError("This is an abstract method!")
@abstractmethod
def clean(self) -> None:
"""Function to erase any pre-existing files to be recreated by a Python Compose Unit."""
raise NotImplementedError("This is an abstract method!")