feat: add todo
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
# Todo
|
||||
|
||||
- Use "source" and "sink" to explicitly represent the input and output of job to replace current circumstance that use explicit job name to declare dependencies. After this change, the dependency network will be automaticlaly calculated from "source" and "sink" relation.
|
||||
- Peel `assemblicon` off as an independent repository and let the builder of this repository refer it.
|
||||
@@ -1,6 +1,7 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from ..utils import Artifact
|
||||
|
||||
|
||||
class Sink(ABC):
|
||||
"""
|
||||
Abstract base class for all sinks.
|
||||
@@ -8,4 +9,13 @@ class Sink(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def push_artifact(self, art: Artifact) -> None:
|
||||
"""Push given artifact into this sink."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def __hash__(self) -> int:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def __eq__(self, other) -> bool:
|
||||
pass
|
||||
|
||||
@@ -1,12 +1,24 @@
|
||||
from ..utils import Artifact
|
||||
from .common import Sink
|
||||
|
||||
class TempDirSink(Sink):
|
||||
|
||||
__args: tuple[str, ...]
|
||||
class TempDirSink(Sink):
|
||||
__path_comps: tuple[str, ...]
|
||||
|
||||
def __init__(self, *args: str) -> None:
|
||||
self.__args = tuple(args)
|
||||
self.__path_comps = tuple(args)
|
||||
|
||||
def push_artifact(self, art: Artifact) -> None:
|
||||
pass
|
||||
|
||||
def __hash__(self) -> int:
|
||||
return hash(self.__path_comps)
|
||||
|
||||
def __eq__(self, other) -> bool:
|
||||
if self is other:
|
||||
return True
|
||||
|
||||
if not isinstance(other, TempDirSink):
|
||||
return NotImplemented
|
||||
|
||||
return self.__path_comps == other.__path_comps
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from ..utils import Artifact
|
||||
|
||||
|
||||
class Source(ABC):
|
||||
"""
|
||||
Abstract base class for all sources.
|
||||
@@ -8,4 +9,13 @@ class Source(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def pull_artifact(self) -> Artifact:
|
||||
"""Pull artifact from this source."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def __hash__(self) -> int:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def __eq__(self, other) -> bool:
|
||||
pass
|
||||
|
||||
@@ -10,3 +10,15 @@ class TempDirSource(Source):
|
||||
|
||||
def pull_artifact(self) -> Artifact:
|
||||
pass
|
||||
|
||||
def __hash__(self) -> int:
|
||||
return hash(self.__path_comps)
|
||||
|
||||
def __eq__(self, other) -> bool:
|
||||
if self is other:
|
||||
return True
|
||||
|
||||
if not isinstance(other, TempDirSource):
|
||||
return NotImplemented
|
||||
|
||||
return self.__path_comps == other.__path_comps
|
||||
|
||||
Reference in New Issue
Block a user