Skip to content

Commit ffd55f8

Browse files
agudysaziele
andauthored
Added mode info for veryfying availability of submodules binaries.
Co-authored-by: aziele <[email protected]>
1 parent 93a364b commit ffd55f8

File tree

5 files changed

+54
-8
lines changed

5 files changed

+54
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ jobs:
7272
steps:
7373
- name: help
7474
run: python3 vclust.py
75+
- name: print info
76+
run: python3 vclust.py info
7577

7678
########################################################################################
7779
upload:

.github/workflows/self-hosted.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,35 @@ jobs:
5151
steps:
5252
- name: make
5353
run: make -j32 CXX=g++-${{matrix.compiler}} CC=gcc-${{matrix.compiler}} PLATFORM=${{ matrix.platform }} LEIDEN=true
54+
- name: print info
55+
run: python3 vclust.py info
56+
57+
########################################################################################
58+
print-info:
59+
name: Print info
60+
needs: make
61+
strategy:
62+
fail-fast: false
63+
matrix:
64+
machine: [x64_linux]
65+
platform: [avx2]
66+
compiler: [14]
67+
include:
68+
- {machine: arm64_linux, platform: arm8, compiler: 12}
69+
- {machine: x64_mac, platform: avx2, compiler: 12}
70+
- {machine: arm64_mac, platform: m1, compiler: 12}
71+
72+
runs-on: [self-hosted, vclust, '${{ matrix.machine }}']
73+
74+
steps:
75+
- name: print info
76+
run: python3 vclust.py info
77+
5478

5579
########################################################################################
5680
pipeline-linux:
5781
name: Pipeline (linux)
58-
needs: make
82+
needs: print-info
5983
strategy:
6084
fail-fast: false
6185
matrix:
@@ -70,7 +94,7 @@ jobs:
7094
########################################################################################
7195
pipeline-macos:
7296
name: Pipeline (macOS)
73-
needs: make
97+
needs: print-info
7498
strategy:
7599
fail-fast: false
76100
matrix:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# <img src="./images/logo.svg" alt="Vclust logo" /> Vclust
22

3-
![version](https://img.shields.io/badge/version-1.2.6-blue.svg)
3+
![version](https://img.shields.io/badge/version-1.2.7-blue.svg)
44
[![GitHub downloads](https://img.shields.io/github/downloads/refresh-bio/vclust/total.svg?style=flag&label=GitHub%20downloads)](https://github.com/refresh-bio/vclust/releases)
55
[![Build and tests](../../workflows/Build%20and%20tests/badge.svg)](../../actions/workflows/main.yml)
66
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_dir():
3333

3434

3535
@pytest.mark.parametrize('subcommand',[
36-
'prefilter', 'align', 'cluster',
36+
'prefilter', 'align', 'cluster', 'info',
3737
])
3838
def test_subcommands(subcommand):
3939
cmd = [

vclust.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import typing
1616
import uuid
1717

18-
__version__ = '1.2.6'
18+
__version__ = '1.2.7'
1919

2020
DEFAULT_THREAD_COUNT = min(multiprocessing.cpu_count(), 64)
2121

@@ -33,7 +33,7 @@
3333
'qidx', 'ridx', 'query', 'reference', 'tani', 'gani', 'ani', 'qcov',
3434
'rcov', 'num_alns', 'len_ratio', 'qlen', 'rlen', 'nt_match', 'nt_mismatch',
3535
]
36-
# vclust align output formats
36+
# Vclust align output formats
3737
ALIGN_OUTFMT = {
3838
'lite': ALIGN_FIELDS[:2] + ALIGN_FIELDS[4:11],
3939
'standard': ALIGN_FIELDS[:11],
@@ -546,6 +546,14 @@ def ranged_float_type(value):
546546
help='Show this help message and exit'
547547
)
548548

549+
# Info parser
550+
info_parser = subparsers.add_parser(
551+
'info',
552+
help='Show information about the tool and its dependencies',
553+
formatter_class=fmt,
554+
add_help=False,
555+
)
556+
549557
# Show help message if the script is run without any arguments.
550558
if len(sys.argv[1:]) == 0:
551559
parser.print_help()
@@ -1137,6 +1145,13 @@ def cmd_clusty(
11371145
return cmd
11381146

11391147

1148+
def vclust_info():
1149+
print(f'Vclust {__version__}')
1150+
for bin_path in [BIN_KMERDB, BIN_FASTASPLIT, BIN_LZANI, BIN_CLUSTY]:
1151+
validate_binary(bin_path)
1152+
print(f'{bin_path.name:<20} ok')
1153+
1154+
11401155
class CustomHelpFormatter(argparse.HelpFormatter):
11411156
"""Custom help message formatter for argparse."""
11421157

@@ -1166,11 +1181,16 @@ def main():
11661181
# Initialize logger
11671182
logger = create_logger(
11681183
name='vclust',
1169-
log_level=logging.INFO if args.verbose else logging.ERROR,
1184+
log_level=(logging.INFO
1185+
if (hasattr(args, 'verbose') and args.verbose)
1186+
else logging.ERROR),
11701187
)
11711188

1189+
# Info
1190+
if args.command == 'info':
1191+
vclust_info()
11721192
# Prefilter
1173-
if args.command == 'prefilter':
1193+
elif args.command == 'prefilter':
11741194
args.bin_kmerdb = validate_binary(args.bin_kmerdb)
11751195
args = validate_args_prefilter(args, parser)
11761196
args = validate_args_fasta_input(args, parser)

0 commit comments

Comments
 (0)