models
Data models for source code management functions.
Attributes¶
Classes¶
DefaultSCMTool
¶
DefaultSCMTool(config: SCMConfig)
LatestTagInfo
dataclass
¶
LatestTagInfo(commit_sha: Optional[str] = None, short_commit_sha: Optional[str] = None, distance_to_latest_tag: int = 0, current_version: Optional[str] = None, current_tag: Optional[str] = None, branch_name: Optional[str] = None, short_branch_name: Optional[str] = None, repository_root: Optional[Path] = None, dirty: Optional[bool] = None)
Information about the latest tag.
SCMConfig
dataclass
¶
SCMConfig(tag: bool, sign_tags: bool, tag_name: str, allow_dirty: bool, commit: bool, message: str, parse_pattern: str, tag_message: Optional[str] = None, commit_args: Optional[str] = None, moveable_tags: List[str] = list())
SCMInfo
¶
SCMInfo(config: SCMConfig)
Information about the current source code manager and state.
SCMTool
¶
SCMTool(config: SCMConfig)
Bases: Protocol
Protocol for source code management tools.
Methods:¶
assert_nondirty
¶
assert_nondirty() -> None
Asserts that the repository is not dirty.
| RAISES | DESCRIPTION |
|---|---|
DirtyWorkingDirectoryError
|
If the repository is not clean. |
commit_and_tag
¶
commit_and_tag(files: List[Pathlike], context: MutableMapping, dry_run: bool = False) -> None
Commit and tag files to the repository using the configuration.