From 7ac5009ba6e9b30e6465f308f30bf9aa79c0f01e Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Fri, 21 Jun 2024 13:44:12 +0200 Subject: [PATCH] add version command --- CHANGELOG.md | 9 +++++++++ setup.py | 2 +- spyrmsd/__init__.py | 2 +- spyrmsd/__main__.py | 5 ++++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20cd53b..19a52f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,15 @@ ------------------------------------------------------------------------------ +## Version 0.9.0 + +Date: XX/YY/ZZZ +Contributors: @RMeli + +### Added + +* `--version` CLI option [PR # | @RMeli] + ## Version 0.8.0 Date: 28/05/2024 diff --git a/setup.py b/setup.py index c037c1c..2485053 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ description=short_description[0], long_description=long_description, long_description_content_type="text/markdown", - version="0.8.0", + version="0.9.0-dev", license="MIT", packages=find_packages(), include_package_data=True, diff --git a/spyrmsd/__init__.py b/spyrmsd/__init__.py index c6bef8c..e0221c9 100644 --- a/spyrmsd/__init__.py +++ b/spyrmsd/__init__.py @@ -10,7 +10,7 @@ from .graph import _get_backend as get_backend # noqa: F401 from .graph import _set_backend as set_backend # noqa: F401 -__version__ = "0.8.0" +__version__ = "0.9.0-dev" # This will print latest Zenodo version due.cite( diff --git a/spyrmsd/__main__.py b/spyrmsd/__main__.py index 1de4a72..5875e62 100644 --- a/spyrmsd/__main__.py +++ b/spyrmsd/__main__.py @@ -13,7 +13,7 @@ from spyrmsd.rmsd import rmsdwrapper parser = ap.ArgumentParser( - prog="python -m spyrmsd", + prog="spyrmsd", description="Symmetry-corrected RMSD calculations in Python.", ) @@ -37,6 +37,9 @@ parser.add_argument( "-v", "--verbose", action="store_true", help="Enable verbose mode" ) + parser.add_argument( + "-V", "--version", action="version", version=f"%(prog)s {spyrmsd.__version__}" + ) args = parser.parse_args()