Skip to content
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### New features

- `jobby` overhaul (#59, @kopardev)
- `jobby` overhaul (#59, #75, @kopardev)
- Uses `saccount` to get slurm job information, which should work for any HPC running slurm.
- Has options `--tsv`, `--json`, and `--yaml` to output the job information in those formats. If not specified, markdown is used.
- Can accept a snakemake log file, nextflow log file, or a list of slurm job IDs as input.
Expand Down
9 changes: 9 additions & 0 deletions src/ccbr_tools/jobby.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
jobby 12345678,12345679 --tsv

"""
from .pkg_util import get_version

import subprocess
import sys
Expand Down Expand Up @@ -333,6 +334,14 @@ def main():
print(" jobby <jobid1>,<jobid2> [--tsv|--json|--yaml]")
print(" jobby snakemake.log [--tsv|--json|--yaml]")
print(" jobby .nextflow.log [--tsv|--json|--yaml]")
print(" jobby -v or --version")
print(" jobby -h or --help")
elif len(args) == 1 and ("-v" in args or "--version" in args):
version = get_version()
# add prefix "v" to the version string if not already present
if not version.startswith("v"):
version = f"v{version}"
print(f"jobby: ccbr_tools version: {version}")
else:
jobby(args)

Expand Down
12 changes: 12 additions & 0 deletions tests/test_jobby.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
format_df,
)
from ccbr_tools.pipeline.hpc import get_hpcname
from ccbr_tools.shell import shell_run

HPC = get_hpcname()

Expand Down Expand Up @@ -271,3 +272,14 @@ def test_format_df():
) # extra newline when files were printed
assertions.append([actual, expected])
assert all([actual == expected for actual, expected in assertions])


def test_jobby_version():
output = shell_run("jobby --version")
this_version = shell_run("ccbr_tools --version").split()[-1]
assert all(
[
output.startswith("jobby: ccbr_tools version: "),
output.strip().endswith(this_version),
]
)
Loading