Skip to content

Commit 41373c7

Browse files
Merge pull request #27 from DiogoRibeiro7/fix/fix_tasks
fix: fix version and tag
2 parents 723e370 + b9e9d5c commit 41373c7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

scripts/check_version_match.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,27 @@
33
from pathlib import Path
44
import subprocess
55
import sys
6-
import tomllib
6+
import tomli
7+
78

89
ROOT = Path(__file__).resolve().parents[1]
910

1011

1112
def pyproject_version() -> str:
1213
pyproject_path = ROOT / "pyproject.toml"
1314
with pyproject_path.open("rb") as f:
14-
data = tomllib.load(f)
15+
data = tomli.load(f)
1516
return data["tool"]["poetry"]["version"]
1617

1718

18-
def latest_tag() -> str | None:
19+
def latest_tag() -> str:
1920
try:
2021
tag = subprocess.check_output(
2122
["git", "describe", "--tags", "--abbrev=0"], cwd=ROOT, text=True
2223
).strip()
2324
return tag.lstrip("v")
2425
except subprocess.CalledProcessError:
25-
return None
26+
return "0.0.0"
2627

2728

2829
def main() -> int:

tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test(c: Context) -> None:
5151

5252

5353
@task
54-
def check_version(c: Context) -> None:
54+
def checkversion(c: Context) -> None:
5555
"""Validate that ``pyproject.toml`` matches the latest git tag.
5656
5757
This task runs the ``scripts/check_version_match.py`` helper using Poetry

0 commit comments

Comments
 (0)