Skip to content

Commit

Permalink
refactor: rm __version__ global
Browse files Browse the repository at this point in the history
  • Loading branch information
dbohdan committed Jan 8, 2024
1 parent 717ef65 commit 180520c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/remarshal/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
from rich.style import StyleType

__all__ = [
"__version__",
"DEFAULT_MAX_VALUES",
"FORMATS",
"RICH_ARGPARSE_STYLES",
Expand All @@ -59,7 +58,6 @@
"remarshal",
"traverse",
]
__version__ = importlib.metadata.version("remarshal")

DEFAULT_MAX_VALUES = 1000000
FORMATS = ["cbor", "json", "msgpack", "toml", "yaml"]
Expand Down Expand Up @@ -148,7 +146,12 @@ def _parse_command_line(argv: List[str]) -> argparse.Namespace: # noqa: C901.
formatter_class=RichHelpFormatter,
prog="remarshal",
)
parser.add_argument("-v", "--version", action="version", version=__version__)
parser.add_argument(
"-v",
"--version",
action="version",
version=importlib.metadata.version("remarshal"),
)

input_group = parser.add_mutually_exclusive_group()
input_group.add_argument("input", nargs="?", default="-", help="input file")
Expand Down

0 comments on commit 180520c

Please sign in to comment.