Skip to content

Commit a096eb0

Browse files
0.1.1 - fixes #5
1 parent f943ce1 commit a096eb0

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "schemascii"
7-
version = "0.1.0"
7+
version = "0.1.1"
88
description = "Render ASCII-art schematics to SVG"
99
readme = "README.md"
1010
authors = [{ name = "dragoncoder047", email = "101021094+dragoncoder047@users.noreply.github.com" }]

release.py

+21-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
import argparse
22
import os
3+
import re
4+
import sys
35

46
a = argparse.ArgumentParser("release.py")
57
a.add_argument("version", help="release tag")
6-
a.add_argument("-m", "--message", default=None, help="release commit message")
78
args = a.parse_args()
8-
if args.message is None:
9-
args.message = f"Release {args.version}"
9+
10+
# Patch new version into files
11+
with open("pyproject.toml") as pyproject:
12+
pp_text = pyproject.read()
13+
with open("pyproject.toml", "w") as pyproject:
14+
pyproject.write(
15+
re.sub(r'version = "[\d.]+"', f'version = "{args.version}"', pp_text))
16+
17+
with open("schemascii/__init__.py") as init:
18+
init_text = init.read()
19+
with open("schemascii/__init__.py", "w") as init:
20+
init.write(
21+
re.sub(r'__version__ = "[\d.]+"', f'__version__ = "{args.version}"', init_text))
1022

1123

1224
def cmd(sh_line):
1325
print(sh_line)
14-
os.system(sh_line)
26+
if os.system(sh_line):
27+
sys.exit(1)
1528

1629

1730
cmd("python3 -m build --sdist")
1831
cmd("python3 -m build --wheel")
19-
cmd("git add -A")
20-
cmd(f"git commit -m {args.message!r}")
21-
cmd(f"git tag {args.version}")
22-
cmd("git push --tags")
32+
print("git add -A")
33+
print(f"git commit -m 'blah'")
34+
print(f"git tag {args.version}")
35+
print("git push --tags")

schemascii/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from .utils import XML
77
from .errors import *
88

9-
__version__ = "0.1.0"
9+
__version__ = "0.1.1"
1010

1111
default_options = {
1212
'padding': 10,

0 commit comments

Comments
 (0)