From 4af71369e7f06c770d88d657e781c008dc3d5b00 Mon Sep 17 00:00:00 2001 From: moshi Date: Sun, 4 Sep 2022 22:34:06 +0900 Subject: [PATCH] Add version info --- pyproject.toml | 2 +- src/fastdtlmapper/__init__.py | 1 + src/fastdtlmapper/args.py | 18 +++++++++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 39d9967..3c78b9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "FastDTLmapper" -version = "0.0.0" +version = "0.3.3" description = "Fast genome-wide DTL(Duplication-Transfer-Loss) event mapping tool" authors = ["moshi"] license = "GPL-3.0-only" diff --git a/src/fastdtlmapper/__init__.py b/src/fastdtlmapper/__init__.py index e69de29..e19434e 100644 --- a/src/fastdtlmapper/__init__.py +++ b/src/fastdtlmapper/__init__.py @@ -0,0 +1 @@ +__version__ = "0.3.3" diff --git a/src/fastdtlmapper/args.py b/src/fastdtlmapper/args.py index 9c53f89..235098f 100644 --- a/src/fastdtlmapper/args.py +++ b/src/fastdtlmapper/args.py @@ -10,6 +10,8 @@ from pathlib import Path from typing import List, Optional, Union +from fastdtlmapper import __version__ + @dataclass class Args: @@ -86,7 +88,8 @@ def get_args(argv: Optional[List[str]] = None) -> Args: Args: Args Class """ parser = argparse.ArgumentParser( - description="Fast genome-wide DTL event mapping tool" + description=f"Fast genome-wide DTL event mapping tool (v{__version__})", + add_help=False, ) parser.add_argument( @@ -169,6 +172,19 @@ def get_args(argv: Optional[List[str]] = None) -> Args: default=default_rseed, metavar="", ) + parser.add_argument( + "-v", + "--version", + version=f"v{__version__}", + help="Print version information", + action="version", + ) + parser.add_argument( + "-h", + "--help", + help="Show this help message and exit", + action="help", + ) ####################################################### # Hidden test option for developer #######################################################