From ec54083a21978da1cbdad467540daf75bcbe5168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Mon, 9 Sep 2024 09:31:54 +0200 Subject: [PATCH] Print version only of pre-installed application and c2cciutils --- c2cciutils/configuration.py | 14 +++++--------- c2cciutils/schema.json | 3 +-- c2cciutils/scripts/main.py | 2 +- config.md | 2 +- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/c2cciutils/configuration.py b/c2cciutils/configuration.py index 8d2dbb8ac..4cf5b609a 100644 --- a/c2cciutils/configuration.py +++ b/c2cciutils/configuration.py @@ -380,9 +380,8 @@ class K8SConfiguration(TypedDict, total=False): {"name": "npm", "prefix": "npm ", "cmd": ["npm", "--version"]}, {"name": "make", "cmd": ["make", "--version"], "prefix": "make "}, {"name": "docker", "cmd": ["docker", "--version"]}, - {"name": "docker-compose", "cmd": ["docker-compose", "--version"]}, + {"name": "docker compose", "cmd": ["docker", "compose", "version"]}, {"name": "java", "cmd": ["java", "-version"]}, - {"name": "kubectl", "cmd": ["kubectl", "version"]}, {"name": "helm", "cmd": ["helm", "version"]}, ] """ Default value of the field path 'Print versions versions' """ @@ -528,17 +527,14 @@ class PrintVersions(TypedDict, total=False): - --version name: docker - cmd: - - docker-compose - - --version - name: docker-compose + - docker + - compose + - version + name: docker compose - cmd: - java - -version name: java - - cmd: - - kubectl - - version - name: kubectl - cmd: - helm - version diff --git a/c2cciutils/schema.json b/c2cciutils/schema.json index 1875a4f47..6313cf422 100644 --- a/c2cciutils/schema.json +++ b/c2cciutils/schema.json @@ -459,9 +459,8 @@ { "name": "npm", "prefix": "npm ", "cmd": ["npm", "--version"] }, { "name": "make", "cmd": ["make", "--version"], "prefix": "make " }, { "name": "docker", "cmd": ["docker", "--version"] }, - { "name": "docker-compose", "cmd": ["docker-compose", "--version"] }, + { "name": "docker compose", "cmd": ["docker", "compose", "version"] }, { "name": "java", "cmd": ["java", "-version"] }, - { "name": "kubectl", "cmd": ["kubectl", "version"] }, { "name": "helm", "cmd": ["helm", "version"] } ], "items": { diff --git a/c2cciutils/scripts/main.py b/c2cciutils/scripts/main.py index 90a7b9f07..3327f03d7 100644 --- a/c2cciutils/scripts/main.py +++ b/c2cciutils/scripts/main.py @@ -27,7 +27,7 @@ def main() -> None: print(yaml.dump(c2cciutils.get_config(), default_flow_style=False, Dumper=yaml.SafeDumper)) if args.version: - for pkg in ("c2cciutils", "black", "isort"): + for pkg in ("c2cciutils", "black", "isort", "codespell"): try: print(f"{pkg} {pkg_resources.get_distribution(pkg).version}") except pkg_resources.DistributionNotFound: diff --git a/config.md b/config.md index 50ac05043..044efb363 100644 --- a/config.md +++ b/config.md @@ -147,7 +147,7 @@ _C2C CI utils configuration file_ - **Items** _(string)_ - - **`print_versions`** _(object)_: The print versions configuration. - - **`versions`** _(array)_: Default: `[{"name": "c2cciutils", "cmd": ["c2cciutils", "--version"]}, {"name": "python", "cmd": ["python3", "--version"]}, {"name": "pip", "cmd": ["python3", "-m", "pip", "--version"]}, {"name": "twine", "cmd": ["twine", "--version"]}, {"name": "node", "prefix": "node ", "cmd": ["node", "--version"]}, {"name": "npm", "prefix": "npm ", "cmd": ["npm", "--version"]}, {"name": "make", "cmd": ["make", "--version"], "prefix": "make "}, {"name": "docker", "cmd": ["docker", "--version"]}, {"name": "docker-compose", "cmd": ["docker-compose", "--version"]}, {"name": "java", "cmd": ["java", "-version"]}, {"name": "kubectl", "cmd": ["kubectl", "version"]}, {"name": "helm", "cmd": ["helm", "version"]}]`. + - **`versions`** _(array)_: Default: `[{"name": "c2cciutils", "cmd": ["c2cciutils", "--version"]}, {"name": "python", "cmd": ["python3", "--version"]}, {"name": "pip", "cmd": ["python3", "-m", "pip", "--version"]}, {"name": "twine", "cmd": ["twine", "--version"]}, {"name": "node", "prefix": "node ", "cmd": ["node", "--version"]}, {"name": "npm", "prefix": "npm ", "cmd": ["npm", "--version"]}, {"name": "make", "cmd": ["make", "--version"], "prefix": "make "}, {"name": "docker", "cmd": ["docker", "--version"]}, {"name": "docker compose", "cmd": ["docker", "compose", "version"]}, {"name": "java", "cmd": ["java", "-version"]}, {"name": "helm", "cmd": ["helm", "version"]}]`. - **Items** _(object)_ - **`cmd`** _(array)_: The command that should be used. - **Items** _(string)_