slck/set_version.py
Marc Cataford eacc51aa62
build: replace poetry by pip-sync (#6)
build: pytest call

build: set up venv

test: snapshot update, formatting

chore: author info formatting

chore: author info formatting

build: includes

ci: release update

docs: set_version
2022-10-29 23:22:38 -04:00

21 lines
533 B
Python

"""
Fixes the version of pyproject.toml, for use before the package
artifacts are built.
"""
import sys
import toml
def set_version(new_version: str):
with open("./pyproject.toml", "r", encoding="utf8") as pyproject:
project_config = toml.loads(pyproject.read())
project_config["project"]["version"] = new_version
print("Bumped version to %s" % new_version)
with open("./pyproject.toml", "w", encoding="utf8") as pyproject:
toml.dump(project_config, pyproject)
set_version(sys.argv[1])