Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ ignore = [
]

[tool.ruff.lint.per-file-ignores]
# Top-level CLIs should be allowed to print if needed
"src/dvsim/cli/**.py" = ["T201"]
"tests/**.py" = [
# Checks for boolean passed as positional argument which is useful in the
# main codebase for clarity. However it's common to assert against a boolean
Expand Down
2 changes: 2 additions & 0 deletions src/dvsim/cli/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

"""DVSim CLI main entry point."""

from importlib.metadata import version
from pathlib import Path

import click


@click.group()
@click.version_option(version("dvsim"))
def cli() -> None:
"""DVSim Administration tool.

Expand Down
9 changes: 2 additions & 7 deletions src/dvsim/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import subprocess
import sys
import textwrap
from importlib.metadata import version
from pathlib import Path

from dvsim.flow.factory import make_cfg
Expand All @@ -43,9 +44,6 @@
from dvsim.logging import configure_logging, log
from dvsim.utils import TS_FORMAT, TS_FORMAT_LONG, Timer, rm_path, run_cmd_with_timeout

# TODO: add dvsim_cfg.hjson to retrieve this info
version = 0.1

# The different categories that can be passed to the --list argument.
_LIST_CATEGORIES = ["build_modes", "run_modes", "tests", "regressions"]

Expand Down Expand Up @@ -298,7 +296,7 @@ def parse_args():

parser.add_argument("cfg", metavar=cfg_metavar, help="""Configuration hjson file.""")

parser.add_argument("--version", action="store_true", help="Print version and exit")
parser.add_argument("--version", action="version", version=version("dvsim"))

parser.add_argument(
"--tool",
Expand Down Expand Up @@ -794,9 +792,6 @@ def parse_args():

args = parser.parse_args()

if args.version:
sys.exit()

# Check conflicts
# interactive and remote, r
if args.interactive and args.remote:
Expand Down
Loading