Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chdsbd committed Oct 17, 2023
1 parent a7d591e commit fdffbe6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
15 changes: 13 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ types-PyYAML = "^6.0.1"
types-pytz = "^2021.3.0"
psycopg2-binary = "^2.9.3"
ruff = "^0.0.286"
tomlkit = "^0.12.1"

[tool.black]
line-length = 88
Expand Down
13 changes: 4 additions & 9 deletions s/update-version
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@
from pathlib import Path
import re
import argparse
import tomllib


def find_version() -> str:
pyproject = Path(".").parent.parent / "pyproject.toml"
pyproject_toml = tomllib.loads(pyproject)
return pyproject_toml["tool"]["poetry"]["version"]

import tomlkit

def main():
parser = argparse.ArgumentParser()
Expand All @@ -22,9 +15,11 @@ def main():
pyproject_path = Path(".").parent.parent / "pyproject.toml"
pyproject = pyproject_path.read_text()

current_version = tomllib.loads(pyproject)["tool"]["poetry"]["version"]
current_version = tomlkit.loads(pyproject)["tool"]["poetry"]["version"]

major, minor, patch = [int(x) for x in current_version.split(".")]


match args.version_increment:
case "major":
major += 1
Expand Down

0 comments on commit fdffbe6

Please sign in to comment.