changelog utils
changelog_files
changelog_files(changelog: str) -> list[Path]
Get the ordered list of SQL files in the changelog directory. This is not recursive, it only returns the files in the given changelog directory. Args: changelog (str): The changelog directory. Returns: list[Path]: A list of paths to the changelog files.
Source code in pum/changelog_utils.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
last_version
last_version(config: PumConfig, dir: str | Path = '.', min_version: str | None = None, max_version: str | None = None) -> str | None
Return the last version of the changelogs. The changelogs are sorted by version. If after_current_version is True, only the changelogs that are after the current version will be returned. If after_current_version is False, all changelogs will be returned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
PumConfig
|
The configuration object. |
required |
dir
|
str | Path
|
The directory where the changelogs are located. |
'.'
|
min_version
|
str | None
|
The version to start from (inclusive). |
None
|
max_version
|
str | None
|
The version to end at (inclusive). |
None
|
Returns:
Type | Description |
---|---|
str | None
|
str | None: The last version of the changelogs. If no changelogs are found, None is returned. |
Source code in pum/changelog_utils.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
list_changelogs
list_changelogs(config: PumConfig, dir: str | Path = '.', min_version: str | None = None, max_version: str | None = None) -> list
Return a list of changelogs. The changelogs are sorted by version. If after_current_version is True, only the changelogs that are after the current version will be returned. If after_current_version is False, all changelogs will be returned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
PumConfig
|
The configuration object. |
required |
dir
|
str | Path
|
The directory where the changelogs are located. |
'.'
|
min_version
|
str | None
|
The version to start from (inclusive). |
None
|
max_version
|
str | None
|
The version to end at (inclusive). |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
list
|
A list of changelogs. Each changelog is represented by a Changelog object. |
Source code in pum/changelog_utils.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|