batools.spinoff package¶
Module contents¶
A system to wrangle projects spun off from a parent Ballistica project.
Think of this as ‘subclassing’ the project. Spinoff can arbitrarily filter/override/exclude files from the source project such that only a minimal number of additions and changes need to be included in the spinoff project itself.
Spinoff operates by copying or hard-linking source project files in from a git submodule, while also telling git to ignore those same files. At any point, the submodule/core system can be jettisoned to leave a 100% self contained standalone project. To do this, just kill the submodule and remove the ‘spinoff’ section in .gitignore.
- class batools.spinoff.SpinoffContext(src_root: str, dst_root: str, mode: Mode, *, force: bool = False, verbose: bool = False, print_full_lists: bool = False, override_paths: list[str] | None = None, backport_file: str | None = None, auto_backport: bool = False, describe_path: str | None = None)[source]¶
Bases:
object
Guts of the spinoff system.
- exception BackportInProgressError[source]¶
Bases:
Exception
Error we can raise to bow out of processing during a backport.
- class Mode(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
Mode the context can operate in.
- BACKPORT = 'backport'¶
- CHECK = 'check'¶
- CLEAN = 'clean'¶
- CLEAN_CHECK = 'cleancheck'¶
- CLEAN_LIST = 'cleanlist'¶
- DESCRIBE_PATH = 'describe_path'¶
- DIFF = 'diff'¶
- OVERRIDE = 'override'¶
- STATUS = 'status'¶
- UPDATE = 'update'¶
- classmethod get_active() SpinoffContext [source]¶
Return the context currently running.