slurm-cli 1.1.1__tar.gz → 1.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/PKG-INFO +1 -1
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/pyproject.toml +1 -1
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/cli.py +51 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/LICENSE +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/README.md +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/__init__.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/py.typed +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/__init__.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/accounts.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/associations.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/autocomplete_helpers.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/base_resource.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/config.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/coordinators.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/events.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/job_filter.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/jobs.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/node_filter.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/nodes.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/partition_stats.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/partitions.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/prefix_utils.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/profiles.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/qos.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/reservations.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/resources.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/slurm_config.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/titles.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/users.py +0 -0
- {slurm_cli-1.1.1 → slurm_cli-1.1.2}/src/slurm_cli/utils/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "slurm-cli"
|
|
3
|
-
version = "1.1.
|
|
3
|
+
version = "1.1.2"
|
|
4
4
|
description = "A CLI tool for Slurm cluster management with autocomplete functionality"
|
|
5
5
|
authors = ["Sergey Zhumatiy <szhumatiy@gmail.com>"]
|
|
6
6
|
maintainers = ["Sergey Zhumatiy <szhumatiy@gmail.com>"]
|
|
@@ -46,6 +46,7 @@ from .utils.nodes import Node
|
|
|
46
46
|
from .utils.partition_stats import (
|
|
47
47
|
DEFAULT_COLUMNS as DEFAULT_PSTATS_COLUMNS,
|
|
48
48
|
FIELDS,
|
|
49
|
+
FIELDS as PSTATS_FIELDS,
|
|
49
50
|
HEADERS as PSTATS_HEADERS,
|
|
50
51
|
USER_HEADERS,
|
|
51
52
|
compute_stats,
|
|
@@ -2302,6 +2303,7 @@ def autocomplete(word: str, max_cost: int, size: int) -> None:
|
|
|
2302
2303
|
|
|
2303
2304
|
# Generate resource case patterns from RESOURCES config
|
|
2304
2305
|
resource_case_patterns = generate_bash_resource_case()
|
|
2306
|
+
pstats_fields = " ".join(f for f in PSTATS_FIELDS if not f.startswith("<"))
|
|
2305
2307
|
# all_resources_str = get_all_resource_names()
|
|
2306
2308
|
|
|
2307
2309
|
# Print the script with proper escaping for bash variables
|
|
@@ -2906,6 +2908,46 @@ _slurm_cli_initialize_autocomplete() {{
|
|
|
2906
2908
|
COMPREPLY=($(compgen -W "--dry-run -v --verbose -h --help" -- "$cur"))
|
|
2907
2909
|
return
|
|
2908
2910
|
;;
|
|
2911
|
+
pstats)
|
|
2912
|
+
# "--opt=<TAB>" makes "=" its own word: the option is the previous word
|
|
2913
|
+
local opt="$prev" val="$cur"
|
|
2914
|
+
if [[ "$cur" == "=" ]]; then
|
|
2915
|
+
val=""
|
|
2916
|
+
elif [[ "$prev" == "=" ]]; then
|
|
2917
|
+
opt="${{COMP_WORDS[COMP_CWORD-2]}}"
|
|
2918
|
+
fi
|
|
2919
|
+
case "$opt" in
|
|
2920
|
+
--header)
|
|
2921
|
+
COMPREPLY=($(compgen -W "none full short trunc" -- "$val"))
|
|
2922
|
+
return ;;
|
|
2923
|
+
--style)
|
|
2924
|
+
COMPREPLY=($(compgen -W "{' '.join(STYLE_OPTIONS)}" -- "$val"))
|
|
2925
|
+
return ;;
|
|
2926
|
+
--profile|-P|--delimiter|-d)
|
|
2927
|
+
return ;;
|
|
2928
|
+
--profile-str|--format|-o)
|
|
2929
|
+
# comma-separated field names (sort marks and templates are not completed)
|
|
2930
|
+
local prefix="" partial="$val" selected=""
|
|
2931
|
+
if [[ "$val" == *,* ]]; then
|
|
2932
|
+
prefix="${{val%,*}},"
|
|
2933
|
+
partial="${{val##*,}}"
|
|
2934
|
+
selected=",${{val%,*}},"
|
|
2935
|
+
fi
|
|
2936
|
+
local remaining=""
|
|
2937
|
+
for f in {pstats_fields}; do
|
|
2938
|
+
[[ "$selected" != *",$f,"* ]] && remaining="$remaining $f"
|
|
2939
|
+
done
|
|
2940
|
+
COMPREPLY=($(compgen -W "$remaining" -- "$partial"))
|
|
2941
|
+
[[ -n "$prefix" && ${{#COMPREPLY[@]}} -gt 0 ]] && COMPREPLY=("${{COMPREPLY[@]/#/$prefix}}")
|
|
2942
|
+
return ;;
|
|
2943
|
+
esac
|
|
2944
|
+
if [[ "$cur" == -* ]]; then
|
|
2945
|
+
COMPREPLY=($(compgen -W "-u --users -a --accounts -s --states -U --by-user --header -H --no-header -o --format --profile-str -P --profile -j --json --csv -p --pretty -z --zebra -d --delimiter --style -h --help" -- "$cur"))
|
|
2946
|
+
else
|
|
2947
|
+
COMPREPLY=($(compgen -W "$(_slurm_cache_partitions)" -- "$cur"))
|
|
2948
|
+
fi
|
|
2949
|
+
return
|
|
2950
|
+
;;
|
|
2909
2951
|
autocomplete|help|resources)
|
|
2910
2952
|
# These commands take -h/--help option
|
|
2911
2953
|
COMPREPLY=($(compgen -W "-h --help" -- "$cur"))
|
|
@@ -2972,6 +3014,10 @@ _slurm_cli_initialize_autocomplete() {{
|
|
|
2972
3014
|
# Handle --profile=value format (when = is a separate word)
|
|
2973
3015
|
if [[ ${{COMP_CWORD}} -ge 2 ]]; then
|
|
2974
3016
|
local opt="${{COMP_WORDS[COMP_CWORD-2]}}"
|
|
3017
|
+
if [[ "$opt" == "--header" ]]; then
|
|
3018
|
+
COMPREPLY=($(compgen -W "none full short trunc" -- "$cur"))
|
|
3019
|
+
return
|
|
3020
|
+
fi
|
|
2975
3021
|
if [[ "$opt" == "--profile" || "$opt" == "-P" ]]; then
|
|
2976
3022
|
local profiles="default compact minimal oneline detailed"
|
|
2977
3023
|
if [ -f "$HOME/.config/slurm-cli.profiles" ]; then
|
|
@@ -2987,6 +3033,11 @@ _slurm_cli_initialize_autocomplete() {{
|
|
|
2987
3033
|
fi
|
|
2988
3034
|
fi
|
|
2989
3035
|
;;
|
|
3036
|
+
--header)
|
|
3037
|
+
[[ "$cur" == "=" ]] && cur=""
|
|
3038
|
+
COMPREPLY=($(compgen -W "none full short trunc" -- "$cur"))
|
|
3039
|
+
return
|
|
3040
|
+
;;
|
|
2990
3041
|
--delimiter|-d|--cache-timeout|-t)
|
|
2991
3042
|
# These options need a value, no completion
|
|
2992
3043
|
return
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|