From 3a6e299763b3c3b05d8204c012f005288a2dcddc Mon Sep 17 00:00:00 2001 From: Alex Rubinsteyn Date: Tue, 27 Feb 2024 17:01:36 -0500 Subject: [PATCH] added --version command and git tags --- deploy.sh | 5 ++++- pyensembl/shell.py | 13 ++++++++++--- pyensembl/version.py | 8 +++++++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/deploy.sh b/deploy.sh index c1896d9..780e9bb 100755 --- a/deploy.sh +++ b/deploy.sh @@ -4,4 +4,7 @@ python3 -m pip install --upgrade build && \ python3 -m pip install --upgrade twine && \ rm -rf dist && \ python3 -m build && \ -python3 -m twine upload dist/* +git --help && \ +python3 -m twine upload dist/* && \ +git tag "$(python3 pyensembl/version.py)" && \ +git push --tags diff --git a/pyensembl/shell.py b/pyensembl/shell.py index cd7ab3c..a278eaf 100755 --- a/pyensembl/shell.py +++ b/pyensembl/shell.py @@ -41,17 +41,24 @@ import argparse import logging.config import pkg_resources -import os -from .ensembl_release import EnsemblRelease, MAX_ENSEMBL_RELEASE +from .ensembl_release import EnsemblRelease +from .ensembl_versions import MAX_ENSEMBL_RELEASE from .genome import Genome -from .species import Species +from .version import __version__ logging.config.fileConfig(pkg_resources.resource_filename(__name__, "logging.conf")) logger = logging.getLogger(__name__) parser = argparse.ArgumentParser(usage=__doc__) + +parser.add_argument( + "--version", + action="version", + version='%(prog)s {version}'.format(version=__version__) +) + parser.add_argument( "--overwrite", default=False, diff --git a/pyensembl/version.py b/pyensembl/version.py index 04510af..740c409 100644 --- a/pyensembl/version.py +++ b/pyensembl/version.py @@ -1 +1,7 @@ -__version__ = "2.3.9" +__version__ = "2.3.10" + +def print_version(): + print(f"v{__version__}") + +if __name__ == "__main__": + print_version()