Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
furechan committed Sep 23, 2024
1 parent 874052f commit 2d2e5d9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ build-backend = "hatchling.build"

[project]
name = "mplchart"
version = "0.0.12"
requires-python = ">=3.9"
readme = "output/README.md"
dynamic = ["version"]
license = { text = "MIT License" }
description = "Classic Stock Charts in Python"
urls = { homepage = "https://github.com/furechan/mplchart" }
Expand Down
1 change: 0 additions & 1 deletion src/mplchart/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
""" mplchart package """

__version__ = "0.0.12"
17 changes: 17 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# noinspection PyUnresolvedReferences

import re
from pathlib import Path
from invoke import task # type: ignore

Expand Down Expand Up @@ -52,3 +53,19 @@ def publish(c):
"""Publish to PyPI with twine"""
c.run("pip install -q twine")
c.run("twine upload dist/*.whl")

@task
def bump(c):
"""Bump patch version in pyproject"""
pyproject = Path(__file__).joinpath("../pyproject.toml").resolve(strict=True)
buffer = pyproject.read_text()
pattern = r"^version \s* = \s* \"(.+)\" \s*"
match = re.search(pattern, buffer, flags=re.VERBOSE | re.MULTILINE)
if not match:
raise ValueError("Could not find version setting")
version = tuple(int(i) for i in match.group(1).split("."))
version = version[:-1] + (version[-1]+1, )
version = ".".join(str(v) for v in version)
print(f"Updating version to {version} ...")
buffer = print(re.sub(pattern, f"version = \"{version}\"\n", buffer, flags=re.VERBOSE | re.MULTILINE))
pyproject.write_text(buffer)

0 comments on commit 2d2e5d9

Please sign in to comment.