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
ebe0c1d8
Commit
ebe0c1d8
authored
10 years ago
by
Todd Gamblin
Browse files
Options
Downloads
Patches
Plain Diff
New "extends" relation adds another special list to the package class.
parent
88afad3e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/spack/spack/package.py
+3
-0
3 additions, 0 deletions
lib/spack/spack/package.py
lib/spack/spack/relations.py
+25
-1
25 additions, 1 deletion
lib/spack/spack/relations.py
with
28 additions
and
1 deletion
lib/spack/spack/package.py
+
3
−
0
View file @
ebe0c1d8
...
...
@@ -314,6 +314,9 @@ class SomePackage(Package):
"""
Specs of virtual packages provided by this package, keyed by name.
"""
provided
=
{}
"""
Specs of packages this one extends, keyed by name.
"""
extendees
=
{}
"""
Specs of conflicting packages, keyed by name.
"""
conflicted
=
{}
...
...
This diff is collapsed.
Click to expand it.
lib/spack/spack/relations.py
+
25
−
1
View file @
ebe0c1d8
...
...
@@ -107,8 +107,9 @@ def depends_on(*specs):
"""
Adds a dependencies local variable in the locals of
the calling class, based on args.
"""
pkg
=
get_calling_package_name
()
clocals
=
caller_locals
()
dependencies
=
clocals
.
setdefault
(
'
dependencies
'
,
{})
dependencies
=
caller_locals
().
setdefault
(
'
dependencies
'
,
{})
for
string
in
specs
:
for
spec
in
spack
.
spec
.
parse
(
string
):
if
pkg
==
spec
.
name
:
...
...
@@ -116,6 +117,29 @@ def depends_on(*specs):
dependencies
[
spec
.
name
]
=
spec
def
extends
(
*
specs
):
"""
Same as depends_on, but dependency is symlinked into parent prefix.
This is for Python and other language modules where the module
needs to be installed into the prefix of the Python installation.
Spack handles this by installing modules into their own prefix,
but allowing ONE module version to be symlinked into a parent
Python install at a time.
"""
pkg
=
get_calling_package_name
()
clocals
=
caller_locals
()
dependencies
=
clocals
.
setdefault
(
'
dependencies
'
,
{})
extendees
=
clocals
.
setdefault
(
'
extendees
'
,
{})
for
string
in
specs
:
for
spec
in
spack
.
spec
.
parse
(
string
):
if
pkg
==
spec
.
name
:
raise
CircularReferenceError
(
'
depends_on
'
,
pkg
)
dependencies
[
spec
.
name
]
=
spec
extendees
[
spec
.
name
]
=
spec
def
provides
(
*
specs
,
**
kwargs
):
"""
Allows packages to provide a virtual dependency. If a package provides
'
mpi
'
, other packages can declare that they depend on
"
mpi
"
, and spack
...
...
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