Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Axii
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Software
ArmarX
Meta
Axii
Commits
6786cc8a
Commit
6786cc8a
authored
3 years ago
by
Christian Dreher
Browse files
Options
Downloads
Patches
Plain Diff
feature: Implement both cases where an optional dependency becomes explicit.
parent
54b558c4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Resolve "Optional dependency support"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
armarx_setup/core/module_graph.py
+8
-3
8 additions, 3 deletions
armarx_setup/core/module_graph.py
with
8 additions
and
3 deletions
armarx_setup/core/module_graph.py
+
8
−
3
View file @
6786cc8a
...
...
@@ -51,10 +51,15 @@ class ModuleGraph(nx.DiGraph):
self
.
add_module
(
required_module
,
ws
=
module
.
ws
)
# Add optional dependencies.
for
_
,
module_in_graph
in
self
.
nodes
(
data
=
"
module
"
):
# If this module is an optional dependency of any module in the graph,
# make it required now to retain correct order.
if
module
.
name
in
module_in_graph
.
optional_modules
:
self
.
add_edge
(
module_in_graph
.
name
,
module
.
name
)
for
optional_name
in
module
.
optional_modules
:
# If
the
dependency is already in the graph, it
is a manually set
#
dependency through
the workspace or via a required_module earlier
,
#
and thus not optional
.
# If
an optional
dependency
of this module
is already in the graph, it
#
was either manually set in
the workspace or via a required_module earlier
.
#
Make it an explicit dependency in the graph in this case
.
if
optional_name
in
self
:
self
.
add_edge
(
module
.
name
,
optional_name
)
...
...
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