From c0c75c0167367e8e07f3339baf34eb809911fa04 Mon Sep 17 00:00:00 2001 From: Germann Elsa Sylvia Date: Mon, 24 Oct 2022 16:37:54 +0200 Subject: [PATCH] ADD: caching --- .gitlab-ci.yml | 2 +- dependency-checker.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cd73707c..1efaae8b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,6 @@ check: stage: check script: - source /opt/psi/config/profile.bash - - module load Python/3.8.12 + - module load Python - export COLUMNS=$COLUMNS - python3 dependency-checker.py diff --git a/dependency-checker.py b/dependency-checker.py index 206c8108..94813138 100644 --- a/dependency-checker.py +++ b/dependency-checker.py @@ -2,6 +2,8 @@ import re import subprocess import sys +from functools import cache + assert sys.version_info >= (3, 7), 'Python version is too low, please load a python >= 3.7' def subprocess_cmd(cmd): @@ -44,6 +46,7 @@ class PmodulePackage(): self.true_status = [self.given_status] @staticmethod + @cache def Pmoduliser(pckg_name='', compiler='', mpi_provider=''): default_module_cmd = 'module search ' + pckg_name + ' -a --all-deps --no-header'