proj_flow.log.commit

The proj_flow.log.commit allows analysing the git commits for changelog generation.

proj_flow.log.commit.set_commit_sep(sep: str)
class proj_flow.log.commit.Section(key, header)
key: str

Alias for field number 0

header: str

Alias for field number 1

class proj_flow.log.commit.Level(*values)
BENIGN = 0
PATCH = 2
FEATURE = 3
BREAKING = 4
scope: str

Alias for field number 0

summary: str

Alias for field number 1

hash: str

Alias for field number 2

short_hash: str

Alias for field number 3

is_breaking: bool

Alias for field number 4

breaking_message: List[str]

Alias for field number 5

references: Dict[str, List[str]]

Alias for field number 6

class proj_flow.log.commit.Commit(type, link)
type: str

Alias for field number 0

Alias for field number 1

proj_flow.log.commit.read_tag_date(tag: str, rt: Runtime)
class proj_flow.log.commit.ReleaseInfo(url: str | None = None, is_draft: bool | None = None, ref: str | None = None, tag: str | None = None)
url: str | None = None
is_draft: bool | None = None
ref: str | None = None
tag: str | None = None
class proj_flow.log.commit.Hosting(host_link: str)

Generates links to the hosting service.

property is_active

Can publish a release

Project link to hosting service.

Link to a single commit on this hosting platform.

Link to a comparison page between two tags on this hosting platform.

Link to an issue, based on a reference, provided this hosting platform can recognize it.

abstract add_release(log: Dict[str, List[Link]], setup: LogSetup, git: Git, draft: bool) ReleaseInfo

Publish a release for current setup, putting the log into release notes.

abstract locate_release(release_name: str) ReleaseInfo | None

Locate a release by its name.

abstract upload_to_release(release: ReleaseInfo, directory: str, names: list[str])

Upload package artifacts to the release.

abstract publish(release: ReleaseInfo) ReleaseInfo

Publish given release, return updated release info.

class proj_flow.log.commit.NoHosting

Generates links to the hosting service.

property is_active

Can publish a release

Link to a single commit on this hosting platform.

Link to a comparison page between two tags on this hosting platform.

Link to an issue, based on a reference, provided this hosting platform can recognize it.

add_release(log: Dict[str, List[Link]], setup: LogSetup, git: Git, draft: bool) ReleaseInfo

Publish a release for current setup, putting the log into release notes.

locate_release(release_name: str) ReleaseInfo | None

Locate a release by its name.

upload_to_release(release: ReleaseInfo, directory: str, names: list[str])

Upload package artifacts to the release.

publish(release: ReleaseInfo)

Publish given release, return updated release info.

class proj_flow.log.commit.LogSetup(hosting: ~proj_flow.log.commit.Hosting, prev_tag: str | None, curr_tag: str | None, omit: list[str], scope_fix: ~typing.Dict[str, str] = <factory>, take_all: bool = False)

Represents setup for log extarction.

hosting: Hosting

Generate links to the hosting service.

prev_tag: str | None

Start of commit range. If missing, represent the start of current branch.

curr_tag: str | None

End of commit range. If missing, represent the HEAD of current branch.

omit: list[str]

Refs and ranges of commits to hide in the generated changelog

scope_fix: Dict[str, str]

Allow reacting to commits with typos in scope names

take_all: bool = False

Choose either all Conventional Commits or only feat/fix ones.

property commit_range

Commit range for log retrieval.

Link to a single commit on hosting platform attached to this setup.

Link to a comparison page between two tags on hosting platform attached to this setup.

Link to an issue, based on a reference, provided hosting platform attached to this setup can recognize it.

class proj_flow.log.commit.Remote(name, usage, url)
name: str

Alias for field number 0

usage: str

Alias for field number 1

url: str

Alias for field number 2

class proj_flow.log.commit.Git(rt: Runtime)
rt: Runtime
get_log(setup: LogSetup, silent=False) Tuple[Dict[str, List[Link]], Level]
parse_log(git_log_output: str, separator: str, setup: LogSetup, omit: set[str])
remotes(silent=False)
tag_list(silent=False)

Get list of version tags, in increasing order.

current_branch()

Get currently checked-out branch

cmd(*command: str)
add_files(*files: str)
commit(message: str)
annotated_tag(new_tag: str, message: str)
push_with_refs(remote: str, branch: str)
class proj_flow.log.commit.HostingFactory
abstract from_repo(git: Git, remote: str | None = None) Hosting | None