diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 21208a4..d865f7e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -72,6 +72,8 @@ jobs: steps: - name: help run: python3 vclust.py + - name: print info + run: python3 vclust.py info ######################################################################################## upload: diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index fc4e6f5..58abdae 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -51,11 +51,35 @@ jobs: steps: - name: make run: make -j32 CXX=g++-${{matrix.compiler}} CC=gcc-${{matrix.compiler}} PLATFORM=${{ matrix.platform }} LEIDEN=true + - name: print info + run: python3 vclust.py info + +######################################################################################## + print-info: + name: Print info + needs: make + strategy: + fail-fast: false + matrix: + machine: [x64_linux] + platform: [avx2] + compiler: [14] + include: + - {machine: arm64_linux, platform: arm8, compiler: 12} + - {machine: x64_mac, platform: avx2, compiler: 12} + - {machine: arm64_mac, platform: m1, compiler: 12} + + runs-on: [self-hosted, vclust, '${{ matrix.machine }}'] + + steps: + - name: print info + run: python3 vclust.py info + ######################################################################################## pipeline-linux: name: Pipeline (linux) - needs: make + needs: print-info strategy: fail-fast: false matrix: @@ -70,7 +94,7 @@ jobs: ######################################################################################## pipeline-macos: name: Pipeline (macOS) - needs: make + needs: print-info strategy: fail-fast: false matrix: diff --git a/README.md b/README.md index 2322090..d189a80 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Vclust logo Vclust -![version](https://img.shields.io/badge/version-1.2.6-blue.svg) +![version](https://img.shields.io/badge/version-1.2.7-blue.svg) [![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) [![Build and tests](../../workflows/Build%20and%20tests/badge.svg)](../../actions/workflows/main.yml) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) diff --git a/test.py b/test.py index 8ccf61b..d7f82c4 100755 --- a/test.py +++ b/test.py @@ -33,7 +33,7 @@ def test_dir(): @pytest.mark.parametrize('subcommand',[ - 'prefilter', 'align', 'cluster', + 'prefilter', 'align', 'cluster', 'info', ]) def test_subcommands(subcommand): cmd = [ diff --git a/vclust.py b/vclust.py index 21e81c3..be353f6 100755 --- a/vclust.py +++ b/vclust.py @@ -15,7 +15,7 @@ import typing import uuid -__version__ = '1.2.6' +__version__ = '1.2.7' DEFAULT_THREAD_COUNT = min(multiprocessing.cpu_count(), 64) @@ -33,7 +33,7 @@ 'qidx', 'ridx', 'query', 'reference', 'tani', 'gani', 'ani', 'qcov', 'rcov', 'num_alns', 'len_ratio', 'qlen', 'rlen', 'nt_match', 'nt_mismatch', ] -# vclust align output formats +# Vclust align output formats ALIGN_OUTFMT = { 'lite': ALIGN_FIELDS[:2] + ALIGN_FIELDS[4:11], 'standard': ALIGN_FIELDS[:11], @@ -546,6 +546,14 @@ def ranged_float_type(value): help='Show this help message and exit' ) + # Info parser + info_parser = subparsers.add_parser( + 'info', + help='Show information about the tool and its dependencies', + formatter_class=fmt, + add_help=False, + ) + # Show help message if the script is run without any arguments. if len(sys.argv[1:]) == 0: parser.print_help() @@ -1137,6 +1145,13 @@ def cmd_clusty( return cmd +def vclust_info(): + print(f'Vclust {__version__}') + for bin_path in [BIN_KMERDB, BIN_FASTASPLIT, BIN_LZANI, BIN_CLUSTY]: + validate_binary(bin_path) + print(f'{bin_path.name:<20} ok') + + class CustomHelpFormatter(argparse.HelpFormatter): """Custom help message formatter for argparse.""" @@ -1166,11 +1181,16 @@ def main(): # Initialize logger logger = create_logger( name='vclust', - log_level=logging.INFO if args.verbose else logging.ERROR, + log_level=(logging.INFO + if (hasattr(args, 'verbose') and args.verbose) + else logging.ERROR), ) + # Info + if args.command == 'info': + vclust_info() # Prefilter - if args.command == 'prefilter': + elif args.command == 'prefilter': args.bin_kmerdb = validate_binary(args.bin_kmerdb) args = validate_args_prefilter(args, parser) args = validate_args_fasta_input(args, parser)