-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1196 from mrapp-ke/merge-feature
Merge feature into main branch
- Loading branch information
Showing
20 changed files
with
248 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Defines build targets for updating the project's changelog. | ||
""" | ||
from core.build_unit import BuildUnit | ||
from core.targets import PhonyTarget, TargetBuilder | ||
|
||
from targets.changelog.changelog import print_current_version, print_latest_changelog, update_changelog_bugfix, \ | ||
update_changelog_feature, update_changelog_main, validate_changelog_bugfix, validate_changelog_feature, \ | ||
validate_changelog_main | ||
|
||
TARGETS = TargetBuilder(BuildUnit.for_file(__file__)) \ | ||
.add_phony_target('validate_changelog_bugfix').set_functions(validate_changelog_bugfix) \ | ||
.add_phony_target('validate_changelog_feature').set_functions(validate_changelog_feature) \ | ||
.add_phony_target('validate_changelog_main').set_functions(validate_changelog_main) \ | ||
.add_phony_target('update_changelog_bugfix').set_functions(update_changelog_bugfix) \ | ||
.add_phony_target('update_changelog_feature').set_functions(update_changelog_feature) \ | ||
.add_phony_target('update_changelog_main').set_functions(update_changelog_main) \ | ||
.add_phony_target('print_version').set_functions(print_current_version) \ | ||
.add_phony_target('print_latest_changelog').set_functions(print_latest_changelog) \ | ||
.build() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
build >= 1.2, < 1.3 | ||
wheel >= 0.45, < 0.46 | ||
toml >= 0.10, < 0.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
""" | ||
Author: Michael Rapp ([email protected]) | ||
Provides utilities for reading and writing TOML files via "toml". | ||
""" | ||
from functools import cached_property | ||
from typing import Dict | ||
|
||
from core.build_unit import BuildUnit | ||
from util.io import TextFile, read_file | ||
from util.pip import Pip | ||
|
||
|
||
class TomlFile(TextFile): | ||
""" | ||
A TOML file. | ||
""" | ||
|
||
def __init__(self, build_unit: BuildUnit, file: str): | ||
""" | ||
:param build_unit: The build unit from which the TOML file is read | ||
:param file: The path to the TOML file | ||
""" | ||
super().__init__(file) | ||
self.build_unit = build_unit | ||
|
||
@cached_property | ||
def toml_dict(self) -> Dict: | ||
""" | ||
A dictionary that stores the content of the TOML file. | ||
""" | ||
Pip.for_build_unit(self.build_unit).install_packages('toml') | ||
# pylint: disable=import-outside-toplevel | ||
import toml | ||
with read_file(self.file) as file: | ||
toml_dict = toml.loads(file.read()) | ||
return toml_dict if toml_dict else {} | ||
|
||
def write_lines(self, *lines: str): | ||
super().write_lines(*lines) | ||
|
||
try: | ||
del self.toml_dict | ||
except AttributeError: | ||
pass |
Oops, something went wrong.