Skip to content

Commit bdbfe03

Browse files
committed
feat(smartem-workspace): add --version flag and update badges
1 parent 151c4fe commit bdbfe03

5 files changed

Lines changed: 22 additions & 5 deletions

File tree

packages/smartem-workspace/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# smartem-workspace
22

3-
[![PyPI version](https://badge.fury.io/py/smartem-workspace.svg)](https://pypi.org/project/smartem-workspace/)
3+
[![PyPI version](https://img.shields.io/pypi/v/smartem-workspace)](https://pypi.org/project/smartem-workspace/)
44
[![Python Versions](https://img.shields.io/pypi/pyversions/smartem-workspace.svg)](https://pypi.org/project/smartem-workspace/)
55
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
6-
[![CI](https://github.com/DiamondLightSource/smartem-devtools/actions/workflows/publish-smartem-workspace.yml/badge.svg)](https://github.com/DiamondLightSource/smartem-devtools/actions/workflows/publish-smartem-workspace.yml)
6+
[![CI](https://github.com/DiamondLightSource/smartem-devtools/actions/workflows/release-smartem-workspace.yml/badge.svg)](https://github.com/DiamondLightSource/smartem-devtools/actions/workflows/release-smartem-workspace.yml)
77

88
CLI tool to automate SmartEM multi-repo workspace setup.
99

packages/smartem-workspace/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "smartem-workspace"
7-
version = "0.3.0"
7+
version = "0.4.0"
88
description = "CLI tool to automate SmartEM multi-repo workspace setup"
99
readme = "README.md"
1010
license = "Apache-2.0"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""SmartEM workspace setup CLI tool."""
22

3-
__version__ = "0.1.0"
3+
__version__ = "0.4.0"

packages/smartem-workspace/smartem_workspace/cli.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import typer
77
from rich.console import Console
88

9+
from smartem_workspace import __version__
910
from smartem_workspace.commands.check import (
1011
CheckScope,
1112
apply_fixes,
@@ -52,8 +53,24 @@ def get_console() -> Console:
5253
return console
5354

5455

56+
def version_callback(value: bool) -> None:
57+
if value:
58+
typer.echo(f"smartem-workspace {__version__}")
59+
raise typer.Exit()
60+
61+
5562
@app.callback()
5663
def main(
64+
version: Annotated[
65+
bool,
66+
typer.Option(
67+
"--version",
68+
"-V",
69+
callback=version_callback,
70+
is_eager=True,
71+
help="Show version and exit",
72+
),
73+
] = False,
5774
no_color: Annotated[
5875
bool,
5976
typer.Option("--no-color", help="Disable colored output"),

packages/smartem-workspace/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)