Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVA-3565 - Add Version #34

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions bin/eva-sub-cli.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/usr/bin/env python
import sys

if not sys.warnoptions:
import warnings
warnings.simplefilter("ignore")

import logging
import os
import sys
from argparse import ArgumentParser

from ebi_eva_common_pyutils.logger import logging_config

from eva_sub_cli import main
Expand Down Expand Up @@ -34,8 +38,15 @@ def validate_command_line_arguments(args, argparser):
sys.exit(1)


def get_version():
base_dir = os.path.abspath(os.path.dirname(main.__file__))
version = open(os.path.join(base_dir, 'VERSION')).read().strip()
return f'{version}'


if __name__ == "__main__":
argparser = ArgumentParser(description='EVA Submission CLI - validate and submit data to EVA')
argparser = ArgumentParser(prog='eva-sub-cli', description='EVA Submission CLI - validate and submit data to EVA')
argparser.add_argument('--version', action='version', version=f'%(prog)s {get_version()}')
argparser.add_argument('--submission_dir', required=True, type=str,
help='Full path to the directory where all processing will be done '
'and submission info is/will be stored')
Expand All @@ -53,9 +64,9 @@ def validate_command_line_arguments(args, argparser):
metadata_group = argparser.add_argument_group('Metadata', 'Specify the metadata in a spreadsheet or in a JSON file')
metadata_group = metadata_group.add_mutually_exclusive_group(required=True)
metadata_group.add_argument("--metadata_json",
help="Json file that describe the project, analysis, samples and files")
help="Json file that describe the project, analysis, samples and files")
metadata_group.add_argument("--metadata_xlsx",
help="Excel spreadsheet that describe the project, analysis, samples and files")
help="Excel spreadsheet that describe the project, analysis, samples and files")
argparser.add_argument('--tasks', nargs='*', choices=[VALIDATE, SUBMIT], default=[SUBMIT], type=str.lower,
help='Select a task to perform. Selecting VALIDATE will run the validation regardless of the'
' outcome of previous runs. Selecting SUBMIT will run validate only if the validation'
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
install_requires=requirements,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'Intended Audience :: Science/Research',
'Topic :: Communications :: File Sharing',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3'
],
Expand Down
Loading