Skip to content

Commit

Permalink
Add version setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
shyuep committed Jul 29, 2024
1 parent e36d122 commit 4a84897
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,19 @@ def commit(ctx: Context) -> None:


@task
def set_ver(ctx: Context) -> None:
def set_ver(ctx: Context, version: str=NEW_VER) -> None:

with open("pyproject.toml", encoding="utf-8") as f:
contents = f.read()
contents = re.sub(r"version = ([\.\d\"]+)", f'version = "{NEW_VER}"', contents)
contents = re.sub(r"version = ([\.\d\"]+)", f'version = "{version}"', contents)

with open("pyproject.toml", "w", encoding="utf-8") as f:
f.write(contents)


@task
def release(ctx: Context, notest: bool = False) -> None:
set_ver(ctx)
def release(ctx: Context, notest: bool = False, version: str=NEW_VER) -> None:
set_ver(ctx, version)
if not notest:
test(ctx)
update_doc(ctx)
Expand Down

0 comments on commit 4a84897

Please sign in to comment.