Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 5 additions & 30 deletions bin/bump-version.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,13 @@
#!/usr/bin/env python3
import tomllib
import subprocess

import tomli_w


def bump_version(version: str) -> str:
splitted_version = version.split(".")
bumped_version = int(splitted_version[-1]) + 1
splitted_version[-1] = str(bumped_version)
return ".".join(splitted_version)


def main() -> None:
with open("uv.lock", "rb") as fd:
data = tomllib.load(fd)

package = next(p for p in data["package"] if p["name"] == "edit-python-pe")

version = bump_version(package["version"])

package["version"] = version

with open("uv.lock", "wb") as fd:
tomli_w.dump(data, fd)

with open("pyproject.toml", "rb") as fd:
data = tomllib.load(fd)

data["project"]["version"] = package["version"]

with open("pyproject.toml", "wb") as fd:
tomli_w.dump(data, fd)

subprocess.run(["uv", "version", "--bump", "patch"])
result = subprocess.run(
["uv", "version", "--short"], stdout=subprocess.PIPE, encoding="utf-8"
)
version = result.stdout.strip()
subprocess.run(["git", "add", "uv.lock"])
subprocess.run(["git", "add", "pyproject.toml"])
subprocess.run(["git", "commit", "-m", f"bump version to {version}"])
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "edit-python-pe"
version = "0.2.4"
version = "0.2.5"
description = "Allows member and project profile editing onto python.pe git repository"
readme = "README.md"
authors = [
Expand Down
Loading