From e1adc6ca406c3bdbca12c6b3032c0b8f8b2a6cbf Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Wed, 9 Feb 2022 10:45:54 -0600 Subject: Replace toml with tomli for TOML v1 support (#43) * Replace toml with tomli for TOML v1 support --- .hooks/make_release_commit.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to '.hooks/make_release_commit.py') diff --git a/.hooks/make_release_commit.py b/.hooks/make_release_commit.py index a0cdf18..3097ebb 100644 --- a/.hooks/make_release_commit.py +++ b/.hooks/make_release_commit.py @@ -1,11 +1,12 @@ #!/usr/bin/env python3 -import toml +import tomli import subprocess from pathlib import Path def create_release_commit(): cwd = Path.cwd() - pyproject = toml.load(cwd / 'pyproject.toml') + with open(cwd / 'pyproject.toml', 'rb') as file: + pyproject = tomli.load(file) version = pyproject['tool']['poetry']['version'] p = subprocess.Popen(f'git add . && git commit -m "Release version {version}" && git tag -a "{version}" -m "Release version {version}" && git push && git push --tags', -- cgit v1.2.3