diff --git a/scripts/prepare_changelog.py b/scripts/prepare_changelog.py index a033e21..c114d4c 100644 --- a/scripts/prepare_changelog.py +++ b/scripts/prepare_changelog.py @@ -3,37 +3,35 @@ from simplextree import __version__ - def main(): - changelog = Path("CHANGELOG.md") - - with changelog.open() as f: - lines = f.readlines() - - insert_index: int = -1 - for i in range(len(lines)): - line = lines[i] - if line.startswith("## Unreleased"): - insert_index = i + 1 - elif line.startswith(f"## [v{__version__}]"): - print("CHANGELOG already up-to-date") - return - elif line.startswith("## [v"): - break - - if insert_index < 0: - raise RuntimeError("Couldn't find 'Unreleased' section") - - lines.insert(insert_index, "\n") - lines.insert( - insert_index + 1, - f"## [v{__version__}](https://github.com/peekxc/simplextree-py/releases/tag/v{__version__}) - " - f"{datetime.now().strftime('%Y-%m-%d')}\n", - ) - - with changelog.open("w") as f: - f.writelines(lines) - + changelog = Path("CHANGELOG.md") + + with changelog.open() as f: + lines = f.readlines() + + insert_index: int = -1 + for i in range(len(lines)): + line = lines[i] + if line.startswith("## Unreleased"): + insert_index = i + 1 + elif line.startswith(f"## [v{__version__}]"): + print("CHANGELOG already up-to-date") + return + elif line.startswith("## [v"): + break + + if insert_index < 0: + raise RuntimeError("Couldn't find 'Unreleased' section") + + lines.insert(insert_index, "\n") + lines.insert( + insert_index + 1, + f"## [v{__version__}](https://github.com/peekxc/simplextree-py/releases/tag/v{__version__}) - " + f"{datetime.now().strftime('%Y-%m-%d')}\n", + ) + + with changelog.open("w") as f: + f.writelines(lines) if __name__ == "__main__": - main() + main() diff --git a/simplextree/__init__.py b/simplextree/__init__.py index 3644225..8e64f51 100644 --- a/simplextree/__init__.py +++ b/simplextree/__init__.py @@ -1,7 +1,7 @@ # coding: utf-8 -import os -import sys -sys.path.append(os.path.dirname(os.path.abspath(__file__))) +# import os +# import sys +# sys.path.append(os.path.dirname(os.path.abspath(__file__))) __version__ = '0.1.0'