aboutsummaryrefslogtreecommitdiffstats
path: root/.hooks/make_release_commit.py
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2022-02-09 10:45:54 -0600
committerGitHub <noreply@github.com>2022-02-09 18:45:54 +0200
commite1adc6ca406c3bdbca12c6b3032c0b8f8b2a6cbf (patch)
tree76dec0cd4997a7f81ecff3b8df5a5d81cbf25d8d /.hooks/make_release_commit.py
parentFix `taskipy.variables` table name in error message (#39) (diff)
downloadtaskipy2-e1adc6ca406c3bdbca12c6b3032c0b8f8b2a6cbf.zip
Replace toml with tomli for TOML v1 support (#43)
* Replace toml with tomli for TOML v1 support
Diffstat (limited to '.hooks/make_release_commit.py')
-rw-r--r--.hooks/make_release_commit.py5
1 files changed, 3 insertions, 2 deletions
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',