Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mpsd-software-manager-2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MPSD Computational Science
mpsd-software-manager-2
Commits
d7d61df3
Commit
d7d61df3
authored
1 month ago
by
Martin Lang
Browse files
Options
Downloads
Patches
Plain Diff
Missing yaml.Loader; controlled failure if module file incomplete
parent
41f54ef6
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Code review of main
Pipeline
#582740
failed
1 month ago
Stage: linting
Stage: static-code-analysis
Stage: tests
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mpsd_software_manager/spack.py
+10
-2
10 additions, 2 deletions
src/mpsd_software_manager/spack.py
with
10 additions
and
2 deletions
src/mpsd_software_manager/spack.py
+
10
−
2
View file @
d7d61df3
...
@@ -349,7 +349,15 @@ def refresh_modules(compilers: dict[str, Any] | None = None) -> None:
...
@@ -349,7 +349,15 @@ def refresh_modules(compilers: dict[str, Any] | None = None) -> None:
r
'
depends_on\(
"
(intel-oneapi-compilers/[0-9.]+)
"
\)
'
,
classic_content
r
'
depends_on\(
"
(intel-oneapi-compilers/[0-9.]+)
"
\)
'
,
classic_content
)
)
# match.group(1) will fail should we not find the line (should never happen)
# match.group(1) will fail should we not find the line (should never happen)
oneapi_module
=
match
.
group
(
1
)
+
"
.lua
"
try
:
oneapi_module
=
match
.
group
(
1
)
+
"
.lua
"
except
(
AttributeError
,
IndexError
)
as
e
:
logger
.
error
(
"
Failed to find
'
depends_on(intel-oneapi-compilers/...)
'
in
'
%s
'"
,
module_file
,
classic_content
,
)
raise
ModuleGenerationError
()
from
e
oneapi_module_file
=
Config
().
lmod_root
/
"
Core
"
/
oneapi_module
oneapi_module_file
=
Config
().
lmod_root
/
"
Core
"
/
oneapi_module
modules_to_patch
[
oneapi_module_file
]
=
{
modules_to_patch
[
oneapi_module_file
]
=
{
"
family
"
:
ONEAPI_FAMILY
,
"
family
"
:
ONEAPI_FAMILY
,
...
@@ -362,7 +370,7 @@ def refresh_modules(compilers: dict[str, Any] | None = None) -> None:
...
@@ -362,7 +370,7 @@ def refresh_modules(compilers: dict[str, Any] | None = None) -> None:
# patch all intel modules
# patch all intel modules
try
:
try
:
with
open
(
to_patch_file
)
as
f
:
with
open
(
to_patch_file
)
as
f
:
modules_to_patch
=
yaml
.
load
(
f
)
modules_to_patch
=
yaml
.
load
(
f
,
loader
=
yaml
.
Loader
)
except
FileNotFoundError
:
except
FileNotFoundError
:
logger
.
debug
(
"
No intel modules to patch
"
)
logger
.
debug
(
"
No intel modules to patch
"
)
return
return
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment