From 1a6546cd997d0a324124d8f80578f9d900919e8e Mon Sep 17 00:00:00 2001 From: Maximilian Linhoff Date: Wed, 15 Jan 2025 19:09:36 +0100 Subject: [PATCH 1/2] fix: Allow pre-releases and fix error message in DIRAC version check --- src/WebAppDIRAC/scripts/dirac_webapp_run.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/WebAppDIRAC/scripts/dirac_webapp_run.py b/src/WebAppDIRAC/scripts/dirac_webapp_run.py index 6c6be0eb..e63bfa22 100755 --- a/src/WebAppDIRAC/scripts/dirac_webapp_run.py +++ b/src/WebAppDIRAC/scripts/dirac_webapp_run.py @@ -63,17 +63,20 @@ def _checkDIRACVersion(): """ from importlib.metadata import requires, version # pylint: disable=import-error,no-name-in-module from packaging.requirements import Requirement # pylint: disable=no-name-in-module + from packaging.specifiers import SpecifierSet deps = [Requirement(x) for x in requires("WebAppDIRAC")] deps = [x for x in deps if x.name.lower() == "dirac"] if len(deps) != 1: raise NotImplementedError(f"This shouldn't be possible: {deps!r}") + dirac_version = version("DIRAC") - dirac_spec = deps[0].specifier + dirac_spec = SpecifierSet(deps[0].specifier, prereleases=True) + if dirac_version not in dirac_spec: raise RuntimeError( "WebAppDIRAC {} requires {} but {} is incompatible".format( - version("WebAppDIRAC"), dirac_version, dirac_spec + version("WebAppDIRAC"), dirac_spec, dirac_version ) ) From 9a23baa8ac35a15deb3187046f7757294ab82b9f Mon Sep 17 00:00:00 2001 From: Maximilian Linhoff Date: Mon, 26 Jan 2026 17:23:38 +0100 Subject: [PATCH 2/2] fix: fix pre-commit complaint --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 7c2a3502..9b3220f3 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -29,7 +29,7 @@ jobs: - name: Checkout main repository uses: actions/checkout@v5 with: - fetch-depth: 0 # get full history (so no need for "git fetch --unshallow") + fetch-depth: 0 # get full history (so no need for "git fetch --unshallow") # Configure git identity - name: Configure git