Skip to content

Commit ca20628

Browse files
authored
Fixing bump-version.py (#48)
* fixing bump-version.py * bump version to 0.2.5
1 parent 0315096 commit ca20628

File tree

3 files changed

+658
-2938
lines changed

3 files changed

+658
-2938
lines changed

bin/bump-version.py

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,13 @@
11
#!/usr/bin/env python3
2-
import tomllib
32
import subprocess
43

5-
import tomli_w
6-
7-
8-
def bump_version(version: str) -> str:
9-
splitted_version = version.split(".")
10-
bumped_version = int(splitted_version[-1]) + 1
11-
splitted_version[-1] = str(bumped_version)
12-
return ".".join(splitted_version)
13-
144

155
def main() -> None:
16-
with open("uv.lock", "rb") as fd:
17-
data = tomllib.load(fd)
18-
19-
package = next(p for p in data["package"] if p["name"] == "edit-python-pe")
20-
21-
version = bump_version(package["version"])
22-
23-
package["version"] = version
24-
25-
with open("uv.lock", "wb") as fd:
26-
tomli_w.dump(data, fd)
27-
28-
with open("pyproject.toml", "rb") as fd:
29-
data = tomllib.load(fd)
30-
31-
data["project"]["version"] = package["version"]
32-
33-
with open("pyproject.toml", "wb") as fd:
34-
tomli_w.dump(data, fd)
35-
6+
subprocess.run(["uv", "version", "--bump", "patch"])
7+
result = subprocess.run(
8+
["uv", "version", "--short"], stdout=subprocess.PIPE, encoding="utf-8"
9+
)
10+
version = result.stdout.strip()
3611
subprocess.run(["git", "add", "uv.lock"])
3712
subprocess.run(["git", "add", "pyproject.toml"])
3813
subprocess.run(["git", "commit", "-m", f"bump version to {version}"])

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "edit-python-pe"
3-
version = "0.2.4"
3+
version = "0.2.5"
44
description = "Allows member and project profile editing onto python.pe git repository"
55
readme = "README.md"
66
authors = [

0 commit comments

Comments
 (0)