Skip to content

Commit

Permalink
Bump version to v0.1.0 for release
Browse files Browse the repository at this point in the history
  • Loading branch information
peekxc committed Aug 17, 2023
1 parent 1652861 commit 8b34446
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 34 deletions.
60 changes: 29 additions & 31 deletions scripts/prepare_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
6 changes: 3 additions & 3 deletions simplextree/__init__.py
Original file line number Diff line number Diff line change
@@ -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'

Expand Down

0 comments on commit 8b34446

Please sign in to comment.