Skip to content

Commit

Permalink
Fix towncrier run
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep committed Jan 24, 2025
1 parent 8ce811a commit 830b202
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ci/scripts/towncrier_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

import argparse
import subprocess
from pathlib import Path
from typing import TYPE_CHECKING

import tomllib
from packaging.version import Version

if TYPE_CHECKING:
Expand Down Expand Up @@ -54,9 +56,18 @@ def parse_args(argv: Sequence[str] | None = None) -> Args:
def main(argv: Sequence[str] | None = None) -> None:
args = parse_args(argv)

meta = tomllib.loads(Path("pyproject.toml").read_text())

# Run towncrier
subprocess.run(
["towncrier", "build", f"--version={args.version}", "--yes"], check=True
[
"towncrier",
"build",
f"--version={args.version}",
f"--name={meta['project']['name']}",
"--yes",
],
check=True,
)

# Check if we are on the main branch to know if we need to backport
Expand Down

0 comments on commit 830b202

Please sign in to comment.