Skip to content

Commit 379b18d

Browse files
committed
update some deps
1 parent 4ce88fb commit 379b18d

11 files changed

+5160
-3757
lines changed

tests/test_config_loader.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ class TopLevelConfig:
4040
db: MySQLConfig = field(default_factory=MySQLConfig)
4141

4242

43+
@dataclass
44+
class TopLevelConfigWithLists(TopLevelConfig):
45+
backup_dbs: List[MySQLConfig] = field(default_factory=list)
46+
backup_nums: List[int] = field(default_factory=list)
47+
48+
4349
@mark.parametrize(
4450
"path",
4551
[
@@ -319,6 +325,66 @@ def test_load_config_file_with_schema_validation(
319325
},
320326
}
321327

328+
def test_load_config_with_schema_and_targets(
329+
self, hydra_restore_singletons: Any, path: str
330+
) -> None:
331+
ConfigStore.instance().store(
332+
name="config_with_schema", node=TopLevelConfig, provider="this_test"
333+
)
334+
ConfigStore.instance().store(
335+
group="db", name="base_mysql", node=MySQLConfig, provider="this_test"
336+
)
337+
338+
config_loader = ConfigLoaderImpl(
339+
config_search_path=create_config_search_path(path)
340+
)
341+
342+
cfg = config_loader.load_configuration(
343+
config_name="schema_ignore_target",
344+
overrides=["db.user=test"],
345+
run_mode=RunMode.RUN,
346+
)
347+
348+
with open_dict(cfg):
349+
del cfg["hydra"]
350+
assert cfg == {
351+
"normal_yaml_config": False,
352+
"db": {
353+
"driver": "???",
354+
"host": "localhost",
355+
"port": "3306",
356+
"user": "test",
357+
"password": "???",
358+
},
359+
"backup_dbs": [
360+
{
361+
"driver": "???",
362+
"host": "localhost",
363+
"port": "3307",
364+
"user": "dummy",
365+
"password": "backup",
366+
},
367+
{
368+
"driver": "mysql",
369+
"host": "127.0.0.1",
370+
"port": "3308",
371+
"user": "dummy",
372+
"password": "backup",
373+
},
374+
],
375+
"backup_nums": [1, 2, 3],
376+
}
377+
378+
# verify illegal modification is rejected at runtime
379+
with raises(ValidationError):
380+
cfg.db.port = "fail"
381+
382+
# verify illegal override is rejected during load
383+
with raises(HydraException):
384+
config_loader.load_configuration(
385+
config_name="db/mysql", overrides=["db.port=fail"], run_mode=RunMode.RUN
386+
)
387+
322388
def test_load_config_with_validation_error(
323389
self, hydra_restore_singletons: Any, path: str
324390
) -> None:

website/docusaurus.config.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626
"1.0": "https://github.com/facebookresearch/hydra/blob/1.0_branch/",
2727
current: "https://github.com/facebookresearch/hydra/blob/main/",
2828
},
29-
},
29+
},
3030
themeConfig: {
3131
announcementBar: {
3232
id: 'support_ukraine',
@@ -36,19 +36,16 @@ module.exports = {
3636
textColor: '#fff',
3737
isCloseable: false,
3838
},
39-
googleAnalytics: {
40-
trackingID: 'UA-149862507-1',
41-
},
42-
algolia: {
43-
apiKey: '8e04f3376c4e6e060f9d8d56734fa67b',
44-
indexName: 'hydra',
45-
algoliaOptions: {},
46-
},
39+
// algolia: {
40+
// apiKey: '8e04f3376c4e6e060f9d8d56734fa67b',
41+
// indexName: 'hydra',
42+
// algoliaOptions: {},
43+
// },
4744
// announcementBar: {
4845
// id: 'supportus',
4946
// content:
5047
// '⭐️ If you like Hydra, give it a star on <a target="_blank" rel="noopener noreferrer" href="https://github.com/facebookresearch/hydra">GitHub</a>! ⭐️',
51-
// },
48+
// },
5249
prism: {
5350
additionalLanguages: ['antlr4'],
5451
},
@@ -137,6 +134,9 @@ module.exports = {
137134
theme: {
138135
customCss: require.resolve('./src/css/custom.css'),
139136
},
137+
googleAnalytics: {
138+
trackingID: 'UA-149862507-1',
139+
},
140140
},
141141
],
142142
],

website/fb/sdoc-cache.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"snippets": {},
3+
"description": "@generated"
4+
}

website/package.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,19 @@
1010
"deploy": "docusaurus deploy"
1111
},
1212
"dependencies": {
13-
"@docusaurus/core": "^2.0.0-beta.14",
14-
"@docusaurus/preset-classic": "^2.0.0-beta.14",
13+
"@docusaurus/core": "^2.0.0",
14+
"@docusaurus/preset-classic": "^2.0.0",
15+
"@mdx-js/react": "^1.6.22",
1516
"classnames": "^2.2.6",
16-
"docusaurus-plugin-internaldocs-fb": "0.10.4",
17+
"docusaurus-plugin-internaldocs-fb": "^1.18.5",
1718
"micromatch": "^4.0.8",
18-
"node-fetch": "^2.6.7",
19-
"path-to-regexp": "^1.9.0",
20-
"prism-react-renderer": "1.2.1",
19+
"node-fetch": "^3.3.2",
20+
"path-to-regexp": "^8.2.0",
21+
"prism-react-renderer": "^2.4.0",
2122
"react": "^17.0.2",
2223
"react-dom": "^17.0.2",
2324
"webpack": "^5.94"
2425
},
25-
"resolutions": {
26-
"follow-redirects": "^1.15.6",
27-
"prism-react-renderer": "1.1.0"
28-
},
2926
"browserslist": {
3027
"production": [
3128
">0.2%",

website/sidebars.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
22

33
function FBInternalOnly(elements) {
4-
return process.env.FB_INTERNAL ? elements : [];
4+
return process.env.FB_INTERNAL ? elements : {};
55
}
66

77
module.exports = {
@@ -182,13 +182,13 @@ module.exports = {
182182

183183
],
184184

185-
'FB Only': FBInternalOnly([
185+
...FBInternalOnly({'FB Only': [
186186
'fb/intro',
187187
'fb/fbcode',
188188
'fb/internal-fb-cluster',
189189
'fb/fair-cluster',
190190
'fb/fbcode-configerator-config-source',
191191
'fb/flow-launcher',
192-
]),
192+
]}),
193193
}
194194
}

website/src/components/GithubLink.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import React from "react";
66
import Link from "@docusaurus/Link";
77
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
88

9-
import {useActiveVersion} from "@theme/hooks/useDocs";
9+
import {useActiveVersion} from "@docusaurus/plugin-content-docs/client";
1010

1111
function createGitHubUrl(to) {
1212
const activeVersion = useActiveVersion();
@@ -30,7 +30,7 @@ export default function GithubLink(props) {
3030
}
3131

3232
export function ExampleGithubLink(props) {
33-
const text = props.text ?? "Example (Click Here)"
33+
const text = props.text ?? "Example (Click Here)"
3434
return (
3535
<GithubLink {...props}>
3636
<span>&nbsp;</span><img

website/versioned_sidebars/version-1.0-sidebars.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,6 @@
365365
]
366366
}
367367
]
368-
},
369-
{
370-
"collapsed": true,
371-
"type": "category",
372-
"label": "FB Only",
373-
"items": []
374368
}
375369
]
376-
}
370+
}

website/versioned_sidebars/version-1.1-sidebars.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,12 +431,6 @@
431431
]
432432
}
433433
]
434-
},
435-
{
436-
"collapsed": true,
437-
"type": "category",
438-
"label": "FB Only",
439-
"items": []
440434
}
441435
]
442436
}

website/versioned_sidebars/version-1.2-sidebars.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@
163163
"upgrades/0.11_to_1.0/object_instantiation_changes"
164164
]
165165
}
166-
],
167-
"FB Only": []
166+
]
168167
}
169168
}

website/versioned_sidebars/version-1.3-sidebars.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@
164164
"upgrades/0.11_to_1.0/object_instantiation_changes"
165165
]
166166
}
167-
],
168-
"FB Only": []
167+
]
169168
}
170169
}

0 commit comments

Comments
 (0)