@@ -74,15 +74,23 @@ def test_image_pyprojects(subtests: pytest_subtests.plugin.SubTests):
74
74
manifest = load_manifests_file_for (directory )
75
75
76
76
with subtests .test (msg = "checking the `notebook-software` array" , pyproject = file ):
77
- # TODO(jdanek)
78
- pytest .skip ("checking the `notebook-software` array not yet implemented" )
79
77
for s in manifest .sw :
80
78
if s .get ("name" ) == "Python" :
81
79
assert s .get ("version" ) == f"v{ python } " , (
82
80
"Python version in imagestream does not match Pipfile"
83
81
)
82
+ elif s .get ("name" ) in ("R" , "code-server" ):
83
+ # TODO(jdanek): check not implemented yet
84
+ continue
85
+ elif s .get ("name" ) in ("CUDA" , "ROCm" ):
86
+ # TODO(jdanek): check not implemented yet
87
+ continue
84
88
else :
85
- pytest .fail (f"unexpected { s = } " )
89
+ e = next ((dep for dep in manifest .dep if dep .get ("name" ) == s .get ("name" )), None )
90
+ if e :
91
+ assert s .get ("version" ) == e .get ("version" )
92
+ else :
93
+ pytest .fail (f"unexpected { s = } " )
86
94
87
95
with subtests .test (msg = "checking the `notebook-python-dependencies` array" , pyproject = file ):
88
96
for d in manifest .dep :
@@ -130,6 +138,7 @@ def test_image_pyprojects(subtests: pytest_subtests.plugin.SubTests):
130
138
"Torch" ,
131
139
"Transformers" ,
132
140
"TrustyAI" ,
141
+ "TensorFlow-ROCm" ,
133
142
}
134
143
135
144
name = d ["name" ]
@@ -216,7 +225,7 @@ class VersionData:
216
225
"Numpy" ,
217
226
(
218
227
"1.26" , # trustyai 0.6.2 depends on numpy~=1.26.4
219
- # 2.0 for tensorflow rocm, but we don't have that in manifests
228
+ " 2.0" , # for tensorflow rocm
220
229
"2.1" , # for tensorflow cuda
221
230
"2.2" , # for python 3.11 n-1 images
222
231
"2.3" , # this is our latest where possible
@@ -273,7 +282,7 @@ def test_image_pyprojects_version_alignment(subtests: pytest_subtests.plugin.Sub
273
282
("torchvision" , ("==0.22.1" , "~=0.22.1" , "==0.22.1+cu128" , "==0.22.1+rocm6.2.4" )),
274
283
(
275
284
"matplotlib" ,
276
- ("~=3.10.6" ),
285
+ ("~=3.10.6" , ),
277
286
),
278
287
(
279
288
"numpy" ,
@@ -377,12 +386,8 @@ def is_suffix[T](main_sequence: Sequence[T], suffix_sequence: Sequence[T]):
377
386
378
387
379
388
def _skip_unimplemented_manifests (directory : pathlib .Path , call_skip = True ) -> bool :
380
- # TODO(jdanek): missing manifests
381
- dirs = (
382
- "runtimes/rocm-tensorflow/ubi9-python-3.12" ,
383
- "jupyter/rocm/tensorflow/ubi9-python-3.12" ,
384
- )
385
- for d in dirs :
389
+ unimplemented_dirs = ()
390
+ for d in unimplemented_dirs :
386
391
if is_suffix (directory .parts , pathlib .Path (d ).parts ):
387
392
if call_skip :
388
393
pytest .skip (f"Manifest not implemented { directory .parts } " )
@@ -429,8 +434,11 @@ def load_manifests_file_for(directory: pathlib.Path) -> Manifest:
429
434
)
430
435
current_tag = recommended_tags [0 ] if recommended_tags else imagestream ["spec" ]["tags" ][0 ]
431
436
432
- sw = json .loads (current_tag ["annotations" ]["opendatahub.io/notebook-software" ])
433
- dep = json .loads (current_tag ["annotations" ]["opendatahub.io/notebook-python-dependencies" ])
437
+ try :
438
+ sw = json .loads (current_tag ["annotations" ]["opendatahub.io/notebook-software" ])
439
+ dep = json .loads (current_tag ["annotations" ]["opendatahub.io/notebook-python-dependencies" ])
440
+ except Exception as e :
441
+ raise ValueError (f"invalid json syntax in { manifest_file } " ) from e
434
442
435
443
return Manifest (
436
444
filename = manifest_file ,
0 commit comments