Commit 497d35c2 authored by Sean Solari's avatar Sean Solari
Browse files

Added --version flag

parent e95d62ee
...@@ -29,13 +29,16 @@ Create skeleton recipe from PyPi repo. ...@@ -29,13 +29,16 @@ Create skeleton recipe from PyPi repo.
import os import os
from setuptools import setup, find_packages from setuptools import setup, find_packages
from setuptools.extension import Extension from setuptools.extension import Extension
import sys
from Cython.Build import cythonize from Cython.Build import cythonize
import numpy as np import numpy as np
EXPAM_VERSION = (1, 0, 5)
SOURCE = os.path.dirname(os.path.abspath(__file__)) SOURCE = os.path.dirname(os.path.abspath(__file__))
sys.path.append(SOURCE)
from src.expam import __version__
# Get project description. # Get project description.
with open(os.path.join(SOURCE, "README.md"), mode="r", encoding="utf-8") as f: with open(os.path.join(SOURCE, "README.md"), mode="r", encoding="utf-8") as f:
...@@ -82,7 +85,7 @@ setup( ...@@ -82,7 +85,7 @@ setup(
# Metadata. # Metadata.
# #
name="expam", name="expam",
version="%d.%d.%d" % EXPAM_VERSION, version="%d.%d.%d" % __version__,
description="Metagenomic profiling using a reference phylogeny", description="Metagenomic profiling using a reference phylogeny",
long_description=long_description, long_description=long_description,
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
......
...@@ -8,9 +8,9 @@ from typing import Set ...@@ -8,9 +8,9 @@ from typing import Set
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import numpy as np import numpy as np
from expam import __version__
from expam.utils import die, ls, make_path_absolute, parse_float, parse_int from expam.utils import die, ls, make_path_absolute, parse_float, parse_int
ExpamOptions = namedtuple( ExpamOptions = namedtuple(
'ExpamOptions', 'ExpamOptions',
[ [
...@@ -31,7 +31,8 @@ ExpamOptions = namedtuple( ...@@ -31,7 +31,8 @@ ExpamOptions = namedtuple(
def retrieve_arguments() -> ExpamOptions: def retrieve_arguments() -> ExpamOptions:
parser = ArgumentParser(description=" expam CLI\n--------------\n", formatter_class=RawTextHelpFormatter) parser = ArgumentParser(description=" expam CLI\n--------------\n", formatter_class=RawTextHelpFormatter)
parser.add_argument('--version', action='version', version='%(prog)s ' + ".".join(str(v) for v in __version__))
parser.add_argument("command", default=None, parser.add_argument("command", default=None,
help='\nCommand to execute. Valid commands include:\n' help='\nCommand to execute. Valid commands include:\n'
'-------------------------------------------\n' '-------------------------------------------\n'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment