Skip to content
Open
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 .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions src/WebAppDIRAC/scripts/dirac_webapp_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
)

Expand Down