-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support variables in base files for configs (#1083)
* Support variables in base files for configs Signed-off-by: lizz <[email protected]> * Test json and yaml as well Signed-off-by: lizz <[email protected]> * Add test for recusive base Signed-off-by: lizz <[email protected]> * Test misleading values Signed-off-by: lizz <[email protected]> * Improve comments Signed-off-by: lizz <[email protected]> * Add doc Signed-off-by: lizz <[email protected]> * Improve doc Signed-off-by: lizz <[email protected]> * More tests Signed-off-by: lizz <[email protected]> * Harder test case Signed-off-by: lizz <[email protected]> * use BASE_KEY instead of base Signed-off-by: lizz <[email protected]>
- Loading branch information
Showing
10 changed files
with
251 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"_base_": [ | ||
"./l1.py", | ||
"./l2.yaml", | ||
"./l3.json", | ||
"./l4.py" | ||
], | ||
"item3": false, | ||
"item4": "test", | ||
"item8": "{{fileBasename}}", | ||
"item9": {{ _base_.item2 }}, | ||
"item10": {{ _base_.item7.b.c }} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
_base_ = ['./l1.py', './l2.yaml', './l3.json', './l4.py'] | ||
item3 = False | ||
item4 = 'test' | ||
item8 = '{{fileBasename}}' | ||
item9 = {{ _base_.item2 }} | ||
item10 = {{ _base_.item7.b.c }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
_base_ : ['./l1.py', './l2.yaml', './l3.json', './l4.py'] | ||
item3 : False | ||
item4 : 'test' | ||
item8 : '{{fileBasename}}' | ||
item9 : {{ _base_.item2 }} | ||
item10 : {{ _base_.item7.b.c }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"_base_": [ | ||
"./t.py" | ||
], | ||
"base": "_base_.item8", | ||
"item11": {{ _base_.item8 }}, | ||
"item12": {{ _base_.item9 }}, | ||
"item13": {{ _base_.item10 }}, | ||
"item14": {{ _base_.item1 }}, | ||
"item15": { | ||
"a": { | ||
"b": {{ _base_.item2 }} | ||
}, | ||
"b": [ | ||
{{ _base_.item3 }} | ||
], | ||
"c": [{{ _base_.item4 }}], | ||
"d": [[ | ||
{ | ||
"e": {{ _base_.item5.a }} | ||
} | ||
], | ||
{{ _base_.item6 }}], | ||
"e": {{ _base_.item1 }} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
_base_ = ['./t.py'] | ||
base = '_base_.item8' | ||
item11 = {{ _base_.item8 }} | ||
item12 = {{ _base_.item9 }} | ||
item13 = {{ _base_.item10 }} | ||
item14 = {{ _base_.item1 }} | ||
item15 = dict( | ||
a = dict( b = {{ _base_.item2 }} ), | ||
b = [{{ _base_.item3 }}], | ||
c = [{{ _base_.item4 }}], | ||
d = [[dict(e = {{ _base_.item5.a }})],{{ _base_.item6 }}], | ||
e = {{ _base_.item1 }} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
_base_: ["./t.py"] | ||
base: "_base_.item8" | ||
item11: {{ _base_.item8 }} | ||
item12: {{ _base_.item9 }} | ||
item13: {{ _base_.item10 }} | ||
item14: {{ _base_.item1 }} | ||
item15: | ||
a: | ||
b: {{ _base_.item2 }} | ||
b: [{{ _base_.item3 }}] | ||
c: [{{ _base_.item4 }}] | ||
d: | ||
- [e: {{ _base_.item5.a }}] | ||
- {{ _base_.item6 }} | ||
e: {{ _base_.item1 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
_base_ = ['./u.py'] | ||
item21 = {{ _base_.item11 }} | ||
item22 = item21 | ||
item23 = {{ _base_.item10 }} | ||
item24 = item23 | ||
item25 = dict( | ||
a = dict( b = item24 ), | ||
b = [item24], | ||
c = [[dict(e = item22)],{{ _base_.item6 }}], | ||
e = item21 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters