Bases: PluginSchema
flowchart TD
liblaf.cherries.plugins.git_.Git[Git]
liblaf.cherries.core._plugin_schema.PluginSchema[PluginSchema]
liblaf.cherries.core._plugin.Plugin[Plugin]
liblaf.cherries.core._plugin_schema.PluginSchema --> liblaf.cherries.plugins.git_.Git
liblaf.cherries.core._plugin.Plugin --> liblaf.cherries.core._plugin_schema.PluginSchema
click liblaf.cherries.plugins.git_.Git href "" "liblaf.cherries.plugins.git_.Git"
click liblaf.cherries.core._plugin_schema.PluginSchema href "" "liblaf.cherries.core._plugin_schema.PluginSchema"
click liblaf.cherries.core._plugin.Plugin href "" "liblaf.cherries.core._plugin.Plugin"
Parameters:
-
id
(PluginId, default:
<dynamic>
)
–
-
commit
(bool, default:
False
)
–
-
(
list[Path], default:
<dynamic>
)
–
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list.
The argument must be an iterable if specified.
-
outputs
(list[Path], default:
<dynamic>
)
–
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list.
The argument must be an iterable if specified.
-
repo
(Repo, default:
None
)
–
-
temps
(list[Path], default:
<dynamic>
)
–
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list.
The argument must be an iterable if specified.
-
verify
(bool, default:
False
)
–
Attributes:
Methods:
commit
class-attribute
instance-attribute
id
class-attribute
instance-attribute
manager
class-attribute
instance-attribute
manager: PluginManager = field(
default=None, repr=False, init=False, kw_only=True
)
outputs
class-attribute
instance-attribute
repo
class-attribute
instance-attribute
repo: Repo = field(default=None)
temps
class-attribute
instance-attribute
verify
class-attribute
instance-attribute
end
end(*args, **kwargs) -> None
Source code in src/liblaf/cherries/plugins/git_.py
26
27
28
29
30
31
32
33
34
35
36
37 | @override
@core.impl(before=("Comet",))
def end(self, *args, **kwargs) -> None:
if self.commit and self.repo.is_dirty(untracked_files=True):
try:
self.repo.git.add(all=True)
subprocess.run(["git", "status"], check=False)
message: str = self._make_commit_message()
self.repo.git.commit(message=message, no_verify=not self.verify)
except git.GitCommandError:
logger.exception("")
self.run.log_other("cherries.git.sha", self.repo.head.commit.hexsha)
|
get_other
Source code in src/liblaf/cherries/core/_plugin_schema.py
| def get_other(self, name: str) -> Any:
raise NotImplementedError
|
get_others
Source code in src/liblaf/cherries/core/_plugin_schema.py
| def get_others(self) -> Mapping[str, Any]:
raise NotImplementedError
|
get_param
Source code in src/liblaf/cherries/core/_plugin_schema.py
| def get_param(self, name: str) -> Any:
raise NotImplementedError
|
get_params
Source code in src/liblaf/cherries/core/_plugin_schema.py
| def get_params(self) -> Mapping[str, Any]:
raise NotImplementedError
|
get_step
Source code in src/liblaf/cherries/core/_plugin_schema.py
| def get_step(self) -> int | None:
raise NotImplementedError
|
get_url
Source code in src/liblaf/cherries/core/_plugin_schema.py
| def get_url(self) -> str:
raise NotImplementedError
|
log_asset
log_asset(
path: Path,
name: Path,
*,
bundle: bool = False,
**kwargs,
) -> None
Source code in src/liblaf/cherries/core/_plugin_schema.py
| def log_asset(
self, path: Path, name: Path, *, bundle: bool = False, **kwargs
) -> None:
raise NotImplementedError
|
log_input(
path: Path,
name: Path,
*,
bundle: bool = False,
**kwargs,
) -> None
Source code in src/liblaf/cherries/plugins/git_.py
| @override
@core.impl
def log_input(
self, path: Path, name: Path, *, bundle: bool = False, **kwargs
) -> None:
if bundle:
return
self.inputs.append(self._relative_to_repo(path))
|
log_metric
log_metric(
name: str, value: Any, step: int | None = None, **kwargs
) -> None
Source code in src/liblaf/cherries/core/_plugin_schema.py
| def log_metric(
self, name: str, value: Any, step: int | None = None, **kwargs
) -> None:
raise NotImplementedError
|
log_metrics
log_metrics(
metrics: Mapping[str, Any],
step: int | None = None,
**kwargs,
) -> None
Source code in src/liblaf/cherries/core/_plugin_schema.py
| def log_metrics(
self, metrics: Mapping[str, Any], step: int | None = None, **kwargs
) -> None:
raise NotImplementedError
|
log_other
log_other(name: str, value: Any) -> None
Source code in src/liblaf/cherries/core/_plugin_schema.py
| def log_other(self, name: str, value: Any) -> None:
raise NotImplementedError
|
log_others
Source code in src/liblaf/cherries/core/_plugin_schema.py
| def log_others(self, others: Mapping[str, Any]) -> None:
raise NotImplementedError
|
log_output
log_output(
path: Path,
name: Path,
*,
bundle: bool = False,
**kwargs,
) -> None
Source code in src/liblaf/cherries/plugins/git_.py
| @override
@core.impl
def log_output(
self, path: Path, name: Path, *, bundle: bool = False, **kwargs
) -> None:
if bundle:
return
self.outputs.append(self._relative_to_repo(path))
|
log_param
log_param(name: str, value: Any) -> None
Source code in src/liblaf/cherries/core/_plugin_schema.py
| def log_param(self, name: str, value: Any) -> None:
raise NotImplementedError
|
log_params
Source code in src/liblaf/cherries/core/_plugin_schema.py
| def log_params(self, params: Mapping[str, Any]) -> None:
raise NotImplementedError
|
log_temp
log_temp(
path: Path,
name: Path,
*,
bundle: bool = False,
**kwargs,
) -> None
Source code in src/liblaf/cherries/plugins/git_.py
| @override
@core.impl
def log_temp(
self, path: Path, name: Path, *, bundle: bool = False, **kwargs
) -> None:
if bundle:
return
self.temps.append(self._relative_to_repo(path))
|
set_step
set_step(step: int | None = None) -> None
Source code in src/liblaf/cherries/core/_plugin_schema.py
| def set_step(self, step: int | None = None) -> None:
raise NotImplementedError
|
start
start(*args, **kwargs) -> None
Source code in src/liblaf/cherries/plugins/git_.py
| @override
@core.impl
def start(self, *args, **kwargs) -> None:
self.repo = git.Repo(search_parent_directories=True)
|