Skip to content

Commit

Permalink
Use click (fixes #76)
Browse files Browse the repository at this point in the history
  • Loading branch information
cokelaer committed Nov 17, 2023
1 parent f291809 commit ae410b0
Show file tree
Hide file tree
Showing 14 changed files with 628 additions and 4,137 deletions.
15 changes: 10 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
version: 2
sphinx:
configuration: doc/conf.py
builder: html


formats: all

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"


formats: []
python:
version: 3.8
install:
- requirements: doc/requirements.txt
- method: pip
path: .
- requirements: doc/requirements.txt

# if present, this section is used and python section ignored before sphinx is built
#conda:
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ Changelog
========= ======================================================================
Version Description
========= ======================================================================
0.16.0 * scripts now use click instead of argparse
* All Options classes have now an equivalent using click.
For example GeneralOptions has a class ClickGeneralOptions.
The GeneralOptions is kept for now for back compatibility
0.15.0 * remove useless code (readme, description) related to old rules
* requirements.txt renamed in tools.txt to store the required tools to
run a pipeline.
Expand Down
3,996 changes: 0 additions & 3,996 deletions poetry.lock

This file was deleted.

11 changes: 7 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
#maintainer ?#maintainer email
[tool.poetry]
name = "sequana_pipetools"
version = "0.15.0"
version = "0.16.0"
description = "A set of tools to help building or using Sequana pipelines"
authors = ["Sequana Team"]
license = "BSD-3"
Expand All @@ -33,11 +33,11 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.8"
python = ">=3.8,<4.0"
deprecated = ">=1.2.13"
easydev = ">=0.12.1"
parse = ">=1.19.0"
"ruamel.yaml" = ">=0.17.32"
"ruamel.yaml" = ">=0.18.5"
packaging = ">=23.1"
pykwalify = ">=1.8"
importlib_resources = ">=5.4.0"
Expand All @@ -46,18 +46,21 @@ aiohttp = ">=3.8.4"
tqdm = ">=4.65"
charset-normalizer = "^2"
versionix = ">=0.2.0"
rich-click = "^1.7.1"


[tool.poetry.scripts]
sequana_completion = "sequana_pipetools.scripts.completion:main"
sequana_slurm_status = "sequana_pipetools.scripts.slurm:main"
sequana_pipetools = "sequana_pipetools.scripts.main:main"


[tool.poetry.group.dev.dependencies]
black = "^23.7.0"
pytest = "^7.4.0"
mock = "^5.1.0"
pytest-mock = "^3.11.1"
sequana-fastqc = "^1.7.1"
sequana-rnaseq = "^0.18.0"
sequana-fastqc = "^1.5.0"
pytest-cov = "^4.1.0"

21 changes: 11 additions & 10 deletions sequana_pipetools/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,26 +87,27 @@ def error(msg, pipeline):


def print_version(name):

try:
ver = pkg_resources.require("sequana_{}".format(name))[0].version
print("sequana_{} version: {}".format(name, ver))
except Exception as err:
print(err)
print("sequana_{} version: ?".format(name))

try:
version = pkg_resources.require("sequana")[0].version
print("Sequana version used: {}".format(version))
print("Sequana version: {}".format(version))
except Exception: # pragma: no cover
pass

try:
version = pkg_resources.require("sequana_pipetools")[0].version
print("Sequana_pipetools version used: {}".format(version))
print("Sequana_pipetools version: {}".format(version))
except Exception as err: # pragma: no cover
print(err)
print("Sequana_pipetools version used: ?")
print("Sequana_pipetools version: ?")

try:
ver = pkg_resources.require("sequana_{}".format(name))[0].version
print("pipeline sequana_{} version used: {}".format(name, ver))
except Exception as err:
print(err)
print("pipeline sequana_{} version used: ?".format(name))
sys.exit(1)
print(Colors().purple("\nHow to help ?\n- Please, consider citing us (see sequana.readthedocs.io)"))
print(Colors().purple("- Contribute to the code or documentation"))
print(Colors().purple("- Fill issues on https://github.com/sequana/sequana/issues/new/choose"))
Expand Down
Loading

0 comments on commit ae410b0

Please sign in to comment.