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

uses improved rich CLI #12

Merged
merged 2 commits into from
Nov 25, 2023
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
13 changes: 13 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ If you are in a hurry, just type::

This is pure Python so no need for fancy libraries.

Usage
-----

Then, just type e.g::

versionix fastqc
Expand All @@ -41,6 +44,15 @@ This tool uses a registry so it will work only with resgistered tools, which lis

versionix --registered

Type::

versionix --help

to get more help like this example:

.. image:: doc/versionix_usage.png


DESCRIPTION
===========

Expand All @@ -55,6 +67,7 @@ Changelog
========= ========================================================================
Version Description
========= ========================================================================
0.2.3 More tools in the registry
0.2.2 add all tools required by sequana pipelines (oct 2023)
0.2.1 More tools added.
0.2 simplification. Add tests. Add more tools
Expand Down
Binary file added doc/versionix_usage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "versionix"
version = "0.2.2"
version = "0.2.3"
description = "Get version of any tools"
authors = ["Sequana Team"]
license = "BSD-3"
Expand Down Expand Up @@ -33,6 +33,7 @@ packages = [
[tool.poetry.dependencies]
python = "^3.8"
click = "^8.1.7"
rich-click = "^1.7.1"

[tool.poetry.dev-dependencies]
pytest = "^7.0.1"
Expand Down
12 changes: 10 additions & 2 deletions versionix/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,19 @@ def parser_split_2_strip_v(x):
},
"sequana": {
"options": "--version",
"parser": parser_split_2_strip_v
"parser": parser_split_3
},
"sequana_coverage": {
"options": "--version",
"parser": parser_strip_v
"parser": parser_split_3
},
"sequana_taxonomy": {
"options": "--version",
"parser": parser_split_3
},
"sequana_pipeotools": {
"options": "--version",
"parser": parser_split_3
},
"singularity": {
"options": "version"
Expand Down
12 changes: 10 additions & 2 deletions versionix/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# If not, see <http://www.gnu.org/licenses/>. #
###########################################################################
""".. rubric:: Standalone application dedicated to Damona"""
import click
import rich_click as click
import sys


Expand All @@ -32,14 +32,22 @@

CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])

click.rich_click.USE_MARKDOWN = True
click.rich_click.SHOW_METAVARS_COLUMN = True
click.rich_click.APPEND_METAVARS_HELP = True
click.rich_click.STYLE_ERRORS_SUGGESTION = "magenta italic"
click.rich_click.SHOW_ARGUMENTS = True


@click.command()
@click.argument("standalone", required=False, type=click.STRING, default=None)
@click.version_option(version)
@click.option("--stats", is_flag=True, help="Prints number of registered tools")
@click.option("--registered", is_flag=True, help="Prints the list of registered tools")
def main(**kwargs):
"""Versionix returns the version of installed software.
"""Versionix returns the version of bioinformatics software.

----

versionix fastqc

Expand Down
Loading