mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 00:24:25 +01:00
release.py: Use click for the CLI
This commit is contained in:
parent
c0ef37c46a
commit
be778b8da0
2 changed files with 14 additions and 9 deletions
4
.github/workflows/make_release.yaml
vendored
4
.github/workflows/make_release.yaml
vendored
|
|
@ -21,7 +21,7 @@ jobs:
|
|||
- name: Run version script
|
||||
id: script
|
||||
run: |
|
||||
python extra/release.py "${{ inputs.version }}"
|
||||
python extra/release.py bump "${{ inputs.version }}"
|
||||
- uses: EndBug/add-and-commit@v9
|
||||
name: Commit the changes
|
||||
with:
|
||||
|
|
@ -91,4 +91,4 @@ jobs:
|
|||
- name: Publish distribution 📦 to PyPI
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,15 +2,14 @@
|
|||
|
||||
"""A utility script for automating the beets release process.
|
||||
"""
|
||||
import argparse
|
||||
import datetime
|
||||
import os
|
||||
import re
|
||||
|
||||
import click
|
||||
|
||||
BASE = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
CHANGELOG = os.path.join(BASE, "docs", "changelog.rst")
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("version", type=str)
|
||||
|
||||
# Locations (filenames and patterns) of the version number.
|
||||
VERSION_LOCS = [
|
||||
|
|
@ -155,12 +154,18 @@ def datestamp():
|
|||
f.write(line)
|
||||
|
||||
|
||||
def prep(args: argparse.Namespace):
|
||||
@click.group()
|
||||
def cli():
|
||||
pass
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.argument("version")
|
||||
def bump(version: str) -> None:
|
||||
# Version number bump.
|
||||
datestamp()
|
||||
bump_version(args.version)
|
||||
bump_version(version)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = parser.parse_args()
|
||||
prep(args)
|
||||
cli()
|
||||
|
|
|
|||
Loading…
Reference in a new issue