Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
eic_tools
Spack
Commits
8d2e340e
Commit
8d2e340e
authored
7 years ago
by
Levi Baber
Committed by
Massimiliano Culpo
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add --full-path option to module find (#6838)
parent
a102177d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/spack/spack/cmd/module.py
+10
-2
10 additions, 2 deletions
lib/spack/spack/cmd/module.py
lib/spack/spack/test/cmd/module.py
+6
-2
6 additions, 2 deletions
lib/spack/spack/test/cmd/module.py
with
16 additions
and
4 deletions
lib/spack/spack/cmd/module.py
+
10
−
2
View file @
8d2e340e
...
...
@@ -71,6 +71,11 @@ def setup_parser(subparser):
# spack module find
find_parser
=
sp
.
add_parser
(
'
find
'
,
help
=
'
find module files for packages
'
)
find_parser
.
add_argument
(
'
--full-path
'
,
help
=
'
display full path to module file
'
,
action
=
'
store_true
'
)
arguments
.
add_common_arguments
(
find_parser
,
[
'
constraint
'
,
'
module_type
'
])
# spack module rm
...
...
@@ -208,8 +213,11 @@ def find(module_types, specs, args):
msg
+=
'
no {0} module has been generated for it.
'
tty
.
die
(
msg
.
format
(
module_type
,
spec
))
# ... and if it is print its use name
print
(
writer
.
layout
.
use_name
)
# ... and if it is print its use name or full-path if requested
if
args
.
full_path
:
print
(
writer
.
layout
.
filename
)
else
:
print
(
writer
.
layout
.
use_name
)
@subcommand
(
'
rm
'
)
...
...
This diff is collapsed.
Click to expand it.
lib/spack/spack/test/cmd/module.py
+
6
−
2
View file @
8d2e340e
...
...
@@ -97,11 +97,15 @@ def test_remove_and_add_tcl(database, parser):
assert
os
.
path
.
exists
(
item
)
def
test_find
(
database
,
parser
):
@pytest.mark.parametrize
(
'
cli_args
'
,
[
[
'
--module-type
'
,
'
tcl
'
,
'
libelf
'
],
[
'
--module-type
'
,
'
tcl
'
,
'
--full-path
'
,
'
libelf
'
]
])
def
test_find
(
database
,
parser
,
cli_args
):
"""
Tests the
'
spack module find
'
under a few common scenarios.
"""
# Try to find it for tcl module files
args
=
parser
.
parse_args
([
'
find
'
,
'
--module-type
'
,
'
tcl
'
,
'
libelf
'
]
)
args
=
parser
.
parse_args
([
'
find
'
]
+
cli_args
)
module
.
module
(
parser
,
args
)
...
...
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