inspect-ai 0.3.64__py3-none-any.whl → 0.3.66__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,6 +35,10 @@ def task_config(
35
35
  value = [str(v) for v in value]
36
36
  config_print.append(f"{name}: {','.join(value)}")
37
37
  elif name not in ["limit", "model"]:
38
+ if isinstance(value, list):
39
+ value = ",".join(value)
40
+ if isinstance(value, str):
41
+ value = value.replace("[", "\\[")
38
42
  config_print.append(f"{name}: {value}")
39
43
  values = ", ".join(config_print)
40
44
  if values:
@@ -130,7 +130,7 @@ def progress_count(complete: int, total: int, width: int | None = None) -> str:
130
130
  total_str = f"{total:,}"
131
131
  complete_str = f"{complete:,}"
132
132
  padding = max(0, len(total_str) - len(complete_str))
133
- padded = " " * padding + f"[{complete_str}/{total_str}]"
133
+ padded = " " * padding + f"{complete_str}/{total_str}"
134
134
 
135
135
  # If a width has ben specified, pad up to this width as well
136
136
  if width is not None:
@@ -5,9 +5,9 @@ from typing import Any, AsyncIterator, ClassVar, Coroutine, Generic, Iterator, c
5
5
 
6
6
  import rich
7
7
  from rich.console import Console
8
- from rich.text import Text
9
8
  from textual.app import App, ComposeResult
10
9
  from textual.binding import Binding, BindingType
10
+ from textual.content import Content
11
11
  from textual.css.query import NoMatches
12
12
  from textual.events import Print
13
13
  from textual.widget import Widget
@@ -178,6 +178,10 @@ class TaskScreenApp(App[TR]):
178
178
  # force repaint
179
179
  self.refresh(repaint=True)
180
180
 
181
+ # enable mouse support (this broke in textual 2.0 when running in VS Code)
182
+ assert self.app._driver
183
+ textual_enable_mouse_support(self.app._driver)
184
+
181
185
  try:
182
186
  yield TextualTaskScreen(self)
183
187
  finally:
@@ -304,9 +308,9 @@ class TaskScreenApp(App[TR]):
304
308
 
305
309
  def set_unread(unread: int | None) -> None:
306
310
  if unread is not None:
307
- console_tab.label = Text.from_markup(f"Console ({unread})")
311
+ console_tab.label = Content.from_rich_text(f"Console ({unread}")
308
312
  else:
309
- console_tab.label = Text.from_markup("Console")
313
+ console_tab.label = Content.from_rich_text("Console")
310
314
 
311
315
  self.watch(console_view, "unread", set_unread)
312
316
 
@@ -373,7 +377,7 @@ class TaskScreenApp(App[TR]):
373
377
  def set_title(self, title: str) -> None:
374
378
  tabs = self.app.query_one(TabbedContent)
375
379
  tab = tabs.get_tab(self.tab_id)
376
- tab.label = Text.from_markup(title)
380
+ tab.label = Content.from_rich_text(title)
377
381
 
378
382
  def activate(self) -> None:
379
383
  # show the tab
@@ -16,7 +16,7 @@ from textual.widgets import (
16
16
  OptionList,
17
17
  Static,
18
18
  )
19
- from textual.widgets.option_list import Option, Separator
19
+ from textual.widgets.option_list import Option
20
20
 
21
21
  from inspect_ai._display.textual.widgets.port_mappings import get_url
22
22
  from inspect_ai._util.format import format_progress_time
@@ -142,7 +142,7 @@ class SamplesList(OptionList):
142
142
 
143
143
  # rebuild the list
144
144
  self.clear_options()
145
- options: list[Option | Separator] = []
145
+ options: list[Option] = []
146
146
  for sample in self.samples:
147
147
  table = Table.grid(expand=True)
148
148
  table.add_column(width=20)
@@ -65,15 +65,15 @@ body[class^="vscode-"] .app-main-grid {
65
65
 
66
66
  /* Inspect Text Styles */
67
67
  .text-style-label {
68
- text-transform: uppercase;
68
+ text-transform: uppercase !important;
69
69
  }
70
70
 
71
71
  .text-style-secondary {
72
- color: var(--bs-secondary);
72
+ color: var(--bs-secondary) !important;
73
73
  }
74
74
 
75
75
  .text-style-tertiary {
76
- color: var(--bs-tertiary-color);
76
+ color: var(--bs-tertiary-color) !important;
77
77
  }
78
78
 
79
79
  /* Inspect Font Size Styles */
@@ -14338,15 +14338,15 @@ body[class^="vscode-"] .app-main-grid {
14338
14338
 
14339
14339
  /* Inspect Text Styles */
14340
14340
  .text-style-label {
14341
- text-transform: uppercase;
14341
+ text-transform: uppercase !important;
14342
14342
  }
14343
14343
 
14344
14344
  .text-style-secondary {
14345
- color: var(--bs-secondary);
14345
+ color: var(--bs-secondary) !important;
14346
14346
  }
14347
14347
 
14348
14348
  .text-style-tertiary {
14349
- color: var(--bs-tertiary-color);
14349
+ color: var(--bs-tertiary-color) !important;
14350
14350
  }
14351
14351
 
14352
14352
  /* Inspect Font Size Styles */
@@ -16200,58 +16200,58 @@ ul.jsondiffpatch-textdiff {
16200
16200
  grid-template-columns: max-content max-content;
16201
16201
  column-gap: 1em;
16202
16202
  }
16203
- ._container_43lfg_1 {
16203
+ ._container_1jqar_1 {
16204
16204
  margin-top: 0.5em;
16205
16205
  padding-left: 0;
16206
16206
  }
16207
16207
 
16208
- ._label_43lfg_6 {
16209
- padding-right: 2em;
16210
- padding-left: 0;
16211
- padding-bottom: 0;
16208
+ ._label_1jqar_6 {
16209
+ padding-right: 2em !important;
16210
+ padding-left: 0 !important;
16211
+ padding-bottom: 0 !important;
16212
16212
  font-weight: 400;
16213
- padding-bottom: 0;
16213
+ padding-bottom: 0 !important;
16214
16214
  }
16215
16215
 
16216
- ._wordBreak_43lfg_14 {
16216
+ ._wordBreak_1jqar_14 {
16217
16217
  word-break: break-all;
16218
16218
  }
16219
16219
 
16220
- ._scoreTable_43lfg_18 {
16220
+ ._scoreTable_1jqar_18 {
16221
16221
  width: 100%;
16222
16222
  margin-bottom: 1em;
16223
16223
  }
16224
16224
 
16225
- ._bottomBorder_43lfg_23 {
16225
+ ._bottomBorder_1jqar_23 {
16226
16226
  border-bottom-color: #00000000;
16227
16227
  }
16228
16228
 
16229
- ._headerScore_43lfg_27 {
16229
+ ._headerScore_1jqar_27 {
16230
16230
  padding-left: 2em;
16231
16231
  }
16232
16232
 
16233
- ._targetValue_43lfg_31 {
16234
- padding-right: 2em;
16235
- padding-left: 0;
16236
- padding-top: 0;
16233
+ ._targetValue_1jqar_31 {
16234
+ padding-right: 2em !important;
16235
+ padding-left: 0 !important;
16236
+ padding-top: 0 !important;
16237
16237
  }
16238
16238
 
16239
- ._answerValue_43lfg_37 {
16240
- padding-left: 0;
16241
- padding-top: 0;
16239
+ ._answerValue_1jqar_37 {
16240
+ padding-left: 0 !important;
16241
+ padding-top: 0 !important;
16242
16242
  }
16243
16243
 
16244
- ._scoreValue_43lfg_42 {
16245
- padding-left: 2em;
16246
- padding-top: 0;
16244
+ ._scoreValue_1jqar_42 {
16245
+ padding-left: 2em !important;
16246
+ padding-top: 0 !important;
16247
16247
  }
16248
16248
 
16249
- ._noLeft_43lfg_47 {
16250
- padding-left: 0;
16249
+ ._noLeft_1jqar_47 {
16250
+ padding-left: 0 !important;
16251
16251
  }
16252
16252
 
16253
- ._noTop_43lfg_51 {
16254
- margin-top: 0;
16253
+ ._noTop_1jqar_51 {
16254
+ margin-top: 0 !important;
16255
16255
  }
16256
16256
  ._wrapper_b0it4_1 {
16257
16257
  display: grid;
@@ -22146,7 +22146,7 @@ var require_assets = __commonJS({
22146
22146
  const isArray = Array.isArray(entry2.value);
22147
22147
  if (isArray) {
22148
22148
  const types2 = new Set(
22149
- entry2.value.map((e) => {
22149
+ entry2.value.filter((e) => e !== null).map((e) => {
22150
22150
  return typeof e;
22151
22151
  })
22152
22152
  );
@@ -22243,15 +22243,7 @@ var require_assets = __commonJS({
22243
22243
  return typeof entry2.value === "object";
22244
22244
  },
22245
22245
  render: (id, entry2) => {
22246
- const summary2 = [];
22247
- const keys = Object.keys(entry2.value);
22248
- if (keys.length > 4) {
22249
- summary2.push(...keys.slice(0, 2));
22250
- summary2.push("...");
22251
- summary2.push(...keys.slice(keys.length - 2));
22252
- } else {
22253
- summary2.push(...keys);
22254
- }
22246
+ console.log({ entry: entry2 });
22255
22247
  return {
22256
22248
  rendered: /* @__PURE__ */ jsxRuntimeExports.jsx(
22257
22249
  MetaDataView,
@@ -49460,17 +49452,17 @@ self.onmessage = function (e) {
49460
49452
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$G.grid, children: rows });
49461
49453
  }
49462
49454
  };
49463
- const container$9 = "_container_43lfg_1";
49464
- const label$1 = "_label_43lfg_6";
49465
- const wordBreak = "_wordBreak_43lfg_14";
49466
- const scoreTable = "_scoreTable_43lfg_18";
49467
- const bottomBorder = "_bottomBorder_43lfg_23";
49468
- const headerScore = "_headerScore_43lfg_27";
49469
- const targetValue = "_targetValue_43lfg_31";
49470
- const answerValue = "_answerValue_43lfg_37";
49471
- const scoreValue = "_scoreValue_43lfg_42";
49472
- const noLeft$1 = "_noLeft_43lfg_47";
49473
- const noTop$1 = "_noTop_43lfg_51";
49455
+ const container$9 = "_container_1jqar_1";
49456
+ const label$1 = "_label_1jqar_6";
49457
+ const wordBreak = "_wordBreak_1jqar_14";
49458
+ const scoreTable = "_scoreTable_1jqar_18";
49459
+ const bottomBorder = "_bottomBorder_1jqar_23";
49460
+ const headerScore = "_headerScore_1jqar_27";
49461
+ const targetValue = "_targetValue_1jqar_31";
49462
+ const answerValue = "_answerValue_1jqar_37";
49463
+ const scoreValue = "_scoreValue_1jqar_42";
49464
+ const noLeft$1 = "_noLeft_1jqar_47";
49465
+ const noTop$1 = "_noTop_1jqar_51";
49474
49466
  const styles$F = {
49475
49467
  container: container$9,
49476
49468
  label: label$1,
@@ -58849,7 +58841,14 @@ ${events}
58849
58841
  title: "JSON",
58850
58842
  onSelected: onSelectedTab,
58851
58843
  selected: selectedTab === kSampleJsonTabId,
58852
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$A.padded, styles$A.fullWidth), children: /* @__PURE__ */ jsxRuntimeExports.jsx(JSONPanel, { data: sample2, simple: true }) })
58844
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$A.padded, styles$A.fullWidth), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
58845
+ JSONPanel,
58846
+ {
58847
+ data: sample2,
58848
+ simple: true,
58849
+ className: clsx("text-size-small")
58850
+ }
58851
+ ) })
58853
58852
  }
58854
58853
  ) : null
58855
58854
  ]
@@ -60542,7 +60541,7 @@ ${events}
60542
60541
  });
60543
60542
  });
60544
60543
  const metrics = Object.values(scorers)[0];
60545
- const showReducer = !!metrics[0].reducer;
60544
+ const showReducer = metrics && metrics.length > 0 && !!metrics[0].reducer;
60546
60545
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$3.simpleMetricsRows, children: metrics.map((metric2, i2) => {
60547
60546
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
60548
60547
  VerticalMetric,
@@ -0,0 +1,149 @@
1
+ # ISC License
2
+ #
3
+ # Copyright (c) 2018-2021, Andrea Giammarchi, @WebReflection
4
+ #
5
+ # Permission to use, copy, modify, and/or distribute this software for any
6
+ # purpose with or without fee is hereby granted, provided that the above
7
+ # copyright notice and this permission notice appear in all copies.
8
+ #
9
+ # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ # AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14
+ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ # PERFORMANCE OF THIS SOFTWARE.
16
+
17
+ import json as _json
18
+
19
+ class _Known:
20
+ def __init__(self):
21
+ self.key = []
22
+ self.value = []
23
+
24
+ class _String:
25
+ def __init__(self, value):
26
+ self.value = value
27
+
28
+
29
+ def _array_keys(value):
30
+ keys = []
31
+ i = 0
32
+ for _ in value:
33
+ keys.append(i)
34
+ i += 1
35
+ return keys
36
+
37
+ def _object_keys(value):
38
+ keys = []
39
+ for key in value:
40
+ keys.append(key)
41
+ return keys
42
+
43
+ def _is_array(value):
44
+ return isinstance(value, list) or isinstance(value, tuple)
45
+
46
+ def _is_object(value):
47
+ return isinstance(value, dict)
48
+
49
+ def _is_string(value):
50
+ return isinstance(value, str)
51
+
52
+ def _index(known, input, value):
53
+ input.append(value)
54
+ index = str(len(input) - 1)
55
+ known.key.append(value)
56
+ known.value.append(index)
57
+ return index
58
+
59
+ def _loop(keys, input, known, output):
60
+ for key in keys:
61
+ value = output[key]
62
+ if isinstance(value, _String):
63
+ _ref(key, input[int(value.value)], input, known, output)
64
+
65
+ return output
66
+
67
+ def _ref(key, value, input, known, output):
68
+ if _is_array(value) and not value in known:
69
+ known.append(value)
70
+ value = _loop(_array_keys(value), input, known, value)
71
+ elif _is_object(value) and not value in known:
72
+ known.append(value)
73
+ value = _loop(_object_keys(value), input, known, value)
74
+
75
+ output[key] = value
76
+
77
+ def _relate(known, input, value):
78
+ if _is_string(value) or _is_array(value) or _is_object(value):
79
+ try:
80
+ return known.value[known.key.index(value)]
81
+ except:
82
+ return _index(known, input, value)
83
+
84
+ return value
85
+
86
+ def _transform(known, input, value):
87
+ if _is_array(value):
88
+ output = []
89
+ for val in value:
90
+ output.append(_relate(known, input, val))
91
+ return output
92
+
93
+ if _is_object(value):
94
+ obj = {}
95
+ for key in value:
96
+ obj[key] = _relate(known, input, value[key])
97
+ return obj
98
+
99
+ return value
100
+
101
+ def _wrap(value):
102
+ if _is_string(value):
103
+ return _String(value)
104
+
105
+ if _is_array(value):
106
+ i = 0
107
+ for val in value:
108
+ value[i] = _wrap(val)
109
+ i += 1
110
+
111
+ elif _is_object(value):
112
+ for key in value:
113
+ value[key] = _wrap(value[key])
114
+
115
+ return value
116
+
117
+ def parse(value, *args, **kwargs):
118
+ json = _json.loads(value, *args, **kwargs)
119
+ wrapped = []
120
+ for value in json:
121
+ wrapped.append(_wrap(value))
122
+
123
+ input = []
124
+ for value in wrapped:
125
+ if isinstance(value, _String):
126
+ input.append(value.value)
127
+ else:
128
+ input.append(value)
129
+
130
+ value = input[0]
131
+
132
+ if _is_array(value):
133
+ return _loop(_array_keys(value), input, [value], value)
134
+
135
+ if _is_object(value):
136
+ return _loop(_object_keys(value), input, [value], value)
137
+
138
+ return value
139
+
140
+
141
+ def stringify(value, *args, **kwargs):
142
+ known = _Known()
143
+ input = []
144
+ output = []
145
+ i = int(_index(known, input, value))
146
+ while i < len(input):
147
+ output.append(_transform(known, input, input[i]))
148
+ i += 1
149
+ return _json.dumps(output, *args, **kwargs)
@@ -0,0 +1,63 @@
1
+ from flatted import stringify as _stringify, parse
2
+
3
+ def stringify(value):
4
+ return _stringify(value, separators=(',', ':'))
5
+
6
+ assert stringify([None, None]) == '[[null,null]]'
7
+
8
+ a = []
9
+ o = {}
10
+
11
+ assert stringify(a) == '[[]]'
12
+ assert stringify(o) == '[{}]'
13
+
14
+ a.append(a)
15
+ o['o'] = o
16
+
17
+ assert stringify(a) == '[["0"]]'
18
+ assert stringify(o) == '[{"o":"0"}]'
19
+
20
+ b = parse(stringify(a))
21
+ assert isinstance(b, list) and b[0] == b
22
+
23
+ a.append(1)
24
+ a.append('two')
25
+ a.append(True)
26
+ o['one'] = 1
27
+ o['two'] = 'two'
28
+ o['three'] = True
29
+
30
+ assert stringify(a) == '[["0",1,"1",true],"two"]'
31
+ assert stringify(o) == '[{"o":"0","one":1,"two":"1","three":true},"two"]'
32
+
33
+ a.append(o)
34
+ o['a'] = a
35
+
36
+ assert stringify(a) == '[["0",1,"1",true,"2"],"two",{"o":"2","one":1,"two":"1","three":true,"a":"0"}]'
37
+ assert stringify(o) == '[{"o":"0","one":1,"two":"1","three":true,"a":"2"},"two",["2",1,"1",true,"0"]]'
38
+
39
+ a.append({'test': 'OK'})
40
+ a.append([1, 2, 3])
41
+
42
+ o['test'] = {'test': 'OK'}
43
+ o['array'] = [1, 2, 3]
44
+
45
+ assert stringify(a) == '[["0",1,"1",true,"2","3","4"],"two",{"o":"2","one":1,"two":"1","three":true,"a":"0","test":"3","array":"4"},{"test":"5"},[1,2,3],"OK"]'
46
+ assert stringify(o) == '[{"o":"0","one":1,"two":"1","three":true,"a":"2","test":"3","array":"4"},"two",["2",1,"1",true,"0","3","4"],{"test":"5"},[1,2,3],"OK"]'
47
+
48
+ a2 = parse(stringify(a));
49
+ o2 = parse(stringify(o));
50
+
51
+ assert a2[0] == a2
52
+ assert o2['o'] == o2
53
+
54
+ assert a2[1] == 1 and a2[2] == 'two' and a2[3] == True and isinstance(a2[4], dict)
55
+ assert a2[4] == a2[4]['o'] and a2 == a2[4]['o']['a']
56
+
57
+ str = parse('[{"prop":"1","a":"2","b":"3"},{"value":123},["4","5"],{"e":"6","t":"7","p":4},{},{"b":"8"},"f",{"a":"9"},["10"],"sup",{"a":1,"d":2,"c":"7","z":"11","h":1},{"g":2,"a":"7","b":"12","f":6},{"r":4,"u":"7","c":5}]')
58
+ assert str['b']['t']['a'] == 'sup' and str['a'][1]['b'][0]['c'] == str['b']['t']
59
+
60
+ oo = parse('[{"a":"1","b":"0","c":"2"},{"aa":"3"},{"ca":"4","cb":"5","cc":"6","cd":"7","ce":"8","cf":"9"},{"aaa":"10"},{"caa":"4"},{"cba":"5"},{"cca":"2"},{"cda":"4"},"value2","value3","value1"]');
61
+ assert oo['a']['aa']['aaa'] == 'value1' and oo == oo['b'] and oo['c']['ca']['caa'] == oo['c']['ca']
62
+
63
+ print('OK')
@@ -132,9 +132,11 @@ const contentRenderers: Record<string, ContentRenderer> = {
132
132
  const isArray = Array.isArray(entry.value);
133
133
  if (isArray) {
134
134
  const types = new Set(
135
- entry.value.map((e: unknown) => {
136
- return typeof e;
137
- }),
135
+ entry.value
136
+ .filter((e: unknown) => e !== null)
137
+ .map((e: unknown) => {
138
+ return typeof e;
139
+ }),
138
140
  );
139
141
  return types.size === 1;
140
142
  } else {
@@ -235,16 +237,7 @@ const contentRenderers: Record<string, ContentRenderer> = {
235
237
  },
236
238
  render: (id, entry) => {
237
239
  // Generate a json preview
238
- const summary = [];
239
- const keys = Object.keys(entry.value);
240
- if (keys.length > 4) {
241
- summary.push(...keys.slice(0, 2));
242
- summary.push("...");
243
- summary.push(...keys.slice(keys.length - 2));
244
- } else {
245
- summary.push(...keys);
246
- }
247
-
240
+ console.log({ entry });
248
241
  return {
249
242
  rendered: (
250
243
  <MetaDataView
@@ -213,7 +213,11 @@ export const SampleDisplay: React.FC<SampleDisplayProps> = ({
213
213
  selected={selectedTab === kSampleJsonTabId}
214
214
  >
215
215
  <div className={clsx(styles.padded, styles.fullWidth)}>
216
- <JSONPanel data={sample} simple={true} />
216
+ <JSONPanel
217
+ data={sample}
218
+ simple={true}
219
+ className={clsx("text-size-small")}
220
+ />
217
221
  </div>
218
222
  </TabPanel>
219
223
  ) : null}
@@ -4,11 +4,11 @@
4
4
  }
5
5
 
6
6
  .label {
7
- padding-right: 2em;
8
- padding-left: 0;
9
- padding-bottom: 0;
7
+ padding-right: 2em !important;
8
+ padding-left: 0 !important;
9
+ padding-bottom: 0 !important;
10
10
  font-weight: 400;
11
- padding-bottom: 0;
11
+ padding-bottom: 0 !important;
12
12
  }
13
13
 
14
14
  .wordBreak {
@@ -29,25 +29,25 @@
29
29
  }
30
30
 
31
31
  .targetValue {
32
- padding-right: 2em;
33
- padding-left: 0;
34
- padding-top: 0;
32
+ padding-right: 2em !important;
33
+ padding-left: 0 !important;
34
+ padding-top: 0 !important;
35
35
  }
36
36
 
37
37
  .answerValue {
38
- padding-left: 0;
39
- padding-top: 0;
38
+ padding-left: 0 !important;
39
+ padding-top: 0 !important;
40
40
  }
41
41
 
42
42
  .scoreValue {
43
- padding-left: 2em;
44
- padding-top: 0;
43
+ padding-left: 2em !important;
44
+ padding-top: 0 !important;
45
45
  }
46
46
 
47
47
  .noLeft {
48
- padding-left: 0;
48
+ padding-left: 0 !important;
49
49
  }
50
50
 
51
51
  .noTop {
52
- margin-top: 0;
52
+ margin-top: 0 !important;
53
53
  }
@@ -32,7 +32,7 @@ export const ResultsPanel: React.FC<ResultsPanelProps> = ({ results }) => {
32
32
  });
33
33
 
34
34
  const metrics = Object.values(scorers)[0];
35
- const showReducer = !!metrics[0].reducer;
35
+ const showReducer = metrics && metrics.length > 0 && !!metrics[0].reducer;
36
36
  return (
37
37
  <div className={styles.simpleMetricsRows}>
38
38
  {metrics.map((metric, i) => {
@@ -27,7 +27,9 @@ def resolve_compose_file(parent: str = "") -> str:
27
27
 
28
28
  # dockerfile just needs a compose.yaml synthesized
29
29
  elif has_dockerfile(parent):
30
- return auto_compose_file(COMPOSE_DOCKERFILE_YAML, parent)
30
+ return auto_compose_file(
31
+ COMPOSE_DOCKERFILE_YAML.format(dockerfile=DOCKERFILE), parent
32
+ )
31
33
 
32
34
  # otherwise provide a generic python container
33
35
  else:
@@ -43,7 +45,7 @@ def find_compose_file(parent: str = "") -> str | None:
43
45
 
44
46
  def is_dockerfile(file: str) -> bool:
45
47
  path = Path(file)
46
- return path.name == DOCKERFILE or path.suffix == f".{DOCKERFILE}"
48
+ return path.stem == DOCKERFILE or path.suffix == f".{DOCKERFILE}"
47
49
 
48
50
 
49
51
  def has_dockerfile(parent: str = "") -> bool:
@@ -92,6 +94,7 @@ services:
92
94
  default:
93
95
  build:
94
96
  context: "."
97
+ dockerfile: "{{dockerfile}}"
95
98
  command: "tail -f /dev/null"
96
99
  init: true
97
100
  network_mode: none
@@ -40,7 +40,8 @@ class ComposeProject:
40
40
  # if its a Dockerfile, then config is the auto-generated .compose.yaml
41
41
  if config_path and is_dockerfile(config_path.name):
42
42
  config = auto_compose_file(
43
- COMPOSE_DOCKERFILE_YAML, config_path.parent.as_posix()
43
+ COMPOSE_DOCKERFILE_YAML.format(dockerfile=config_path.name),
44
+ config_path.parent.as_posix(),
44
45
  )
45
46
 
46
47
  # if its another config file, just take its path
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: inspect_ai
3
- Version: 0.3.64
3
+ Version: 0.3.66
4
4
  Summary: Framework for large language model evaluations
5
5
  Author: UK AI Security Institute
6
6
  License: MIT License
@@ -15,12 +15,12 @@ inspect_ai/_cli/util.py,sha256=rOyKR5p08-04IwJdcjakNXD1Gm-dGFtzaTTx7hyArPE,1402
15
15
  inspect_ai/_cli/view.py,sha256=QIL6QP0rJS5kcUzpIqKZMylx-zLAW2JXtjXoNjtxkHo,3113
16
16
  inspect_ai/_display/__init__.py,sha256=t9Xj8FbxvdBNsalnr16U0r3jSTFX9w4yXcUJwb06_6k,405
17
17
  inspect_ai/_display/core/active.py,sha256=6Z0-_6nduUp3UkGLbfYvrvgVVcnYdWLRkpvPOKZ_y5s,1259
18
- inspect_ai/_display/core/config.py,sha256=SuzdFbLTNy6BZYqpx3ZcCuWa0PYXGim4zWx2-JQdqLU,1961
18
+ inspect_ai/_display/core/config.py,sha256=9uEUjoLzcVXr2GxU5-WCEXyJDabCOpSXgnXyH-ETyw4,2130
19
19
  inspect_ai/_display/core/display.py,sha256=zgpNSU39pITyM_Xa41FsGIY5a4JtZbv7bDy7hjmJCM8,3057
20
20
  inspect_ai/_display/core/footer.py,sha256=wMe4P-4Bhx4WV01dUW12o9-KBAoD2CSCvWZ-9_CMSNU,805
21
21
  inspect_ai/_display/core/group.py,sha256=z8CIwQ-8Mm9adQ8JDuMjw94ih9GfymU5s-1qnbKoEPs,2871
22
22
  inspect_ai/_display/core/panel.py,sha256=U0ibyTo9fP_-B_Mta6OfYAaPatZ15bPt72eyzaBB0eY,3853
23
- inspect_ai/_display/core/progress.py,sha256=Nmz6IkMpUdvW6uaAyFJWE3ox6fH2jwT522_4i6GqnBY,4200
23
+ inspect_ai/_display/core/progress.py,sha256=2dIRbpJGUx-Wz89ZABoACBGvJEGWJ3SDrFsuCrrpL7w,4198
24
24
  inspect_ai/_display/core/results.py,sha256=aFLmG1Ij0fxYk2848QgQlesfMeRdHVEg_W9esmeL_S0,7355
25
25
  inspect_ai/_display/core/rich.py,sha256=GPzc-0PWZVOPWxnjfQmNSK66uZXc3x8joz4ethgv_4M,2729
26
26
  inspect_ai/_display/core/textual.py,sha256=kzMTt8ijrodwhDB5V50pP2IBhnUCusVbP86TytU_rA8,870
@@ -28,7 +28,7 @@ inspect_ai/_display/plain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
28
28
  inspect_ai/_display/plain/display.py,sha256=fGITQj6w4-2A4zNMKFW32wdyVB5JpK-LsXMbFckzXTA,6743
29
29
  inspect_ai/_display/rich/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  inspect_ai/_display/rich/display.py,sha256=ecEcahmRJirrYOorcVGuH7Qeyj0NdhsByMxasTxMpFc,10902
31
- inspect_ai/_display/textual/app.py,sha256=DVn7HBE5vXeNUIV4wh6FKZC6W1S9rdUdOOr80J6XdJo,15824
31
+ inspect_ai/_display/textual/app.py,sha256=Ct9aAKw6vFIni5kyOWu0Fd70Sw3xB1pVaMriNEBu3UA,16021
32
32
  inspect_ai/_display/textual/app.tcss,sha256=ymx47Y2fAbce4vPOrpeij1p9qwSipT7Dd6fSxCTknT8,249
33
33
  inspect_ai/_display/textual/display.py,sha256=zTG8k67iT-xq1H8CVwtqZdvuo_O2hsgh4q4y8EKRkf8,2027
34
34
  inspect_ai/_display/textual/theme.py,sha256=SVf2UhQVuEOzzNx1Pl2bqLrofw13ykQKAVnevUpJBYs,588
@@ -36,7 +36,7 @@ inspect_ai/_display/textual/widgets/clock.py,sha256=pxXQOtadf6qdNMLQh_D3bx3SIPoB
36
36
  inspect_ai/_display/textual/widgets/console.py,sha256=lp5lbT9erPjxE1NWzvuJ5Bj8mN2ZZSBTgKQWHinMKgA,1590
37
37
  inspect_ai/_display/textual/widgets/footer.py,sha256=_4Dlzp9kriUVELBEk6HQzgiwLigHe5mH0dZqWr6sGi4,1078
38
38
  inspect_ai/_display/textual/widgets/port_mappings.py,sha256=mxQJGYeZh1aXNmW5z-Ukss7Zwul5qfH5CqtvTLl0BAU,2974
39
- inspect_ai/_display/textual/widgets/samples.py,sha256=qUVN9LJzH1afnwT_Qa8J1HTj754H-PfIv0W5SkKvOI8,18229
39
+ inspect_ai/_display/textual/widgets/samples.py,sha256=rBaBP__MbKEX18B00nQCiLrWO9MmtSn0arh-zL90c8I,18206
40
40
  inspect_ai/_display/textual/widgets/sandbox.py,sha256=VRdC1NGKfog2gXz8a8aCIaXgPDVewW9CuoC-k0LUXfY,1132
41
41
  inspect_ai/_display/textual/widgets/task_detail.py,sha256=UCxQZkKrG6ILacuPpiJaoElezqJNb0njPWPA4IuNVDo,8289
42
42
  inspect_ai/_display/textual/widgets/tasks.py,sha256=Ari4-lsqPVsvAk4ZjdsnbO3l0JBmlifrbT9D7ykoUFA,11175
@@ -122,7 +122,7 @@ inspect_ai/_view/www/.gitignore,sha256=Qyau1UN5uAQB8cwjhokiMEMgJtQCReq-6ohBVCXV8
122
122
  inspect_ai/_view/www/.prettierignore,sha256=SiJfow55o33Kh0KB2BJGQsjgyHNURdtmI097aY6kJzc,85
123
123
  inspect_ai/_view/www/.prettierrc.js,sha256=zCwLdzlQ5eH3rt4QYL8y-GYk4IRw6u0V_N1kJYti7aI,397
124
124
  inspect_ai/_view/www/.tool-versions,sha256=f_sejk8S4O7DHHSB2O2Kb9nt03ih81IgZ2u2ZrwIvEE,14
125
- inspect_ai/_view/www/App.css,sha256=N8NWwXQLV51qeYWcYruH7IJwObptX7RPG3GL8USOypI,26574
125
+ inspect_ai/_view/www/App.css,sha256=wbz5XLohG8zrUaw1JMMRXSwZLN53PZPoZY1xTH6OiMg,26607
126
126
  inspect_ai/_view/www/README.md,sha256=Yq1cv_iB_DOf0xWCNrk8EdtVRtVFkaCzbDWQ_MXYJ8U,949
127
127
  inspect_ai/_view/www/eslint.config.mjs,sha256=wUi4ffMbjLKiLDBegWY6814TFu_ojR5GhA8f9vwIqjE,296
128
128
  inspect_ai/_view/www/favicon.svg,sha256=b9AHYZaO2zBzeKH6G4PwXZMGGW_UxY0omKHam-c9MAs,1508
@@ -138,8 +138,10 @@ inspect_ai/_view/www/.vscode/extensions.json,sha256=E73RWLzcoyeluE_ijGxaNSOK9xC0
138
138
  inspect_ai/_view/www/.vscode/settings.json,sha256=g5hrVnMaYxM06JpiJD2EuE2xjcbF6xNAtL2fuKgG1-8,200
139
139
  inspect_ai/_view/www/dist/index.html,sha256=gpdu6SR-SOH9EWx15cCWHzujMZujnZR5tRlEfROJg2A,997
140
140
  inspect_ai/_view/www/dist/assets/favicon.svg,sha256=b9AHYZaO2zBzeKH6G4PwXZMGGW_UxY0omKHam-c9MAs,1508
141
- inspect_ai/_view/www/dist/assets/index.css,sha256=TsMd1SRYGKUbe3vaKC1hlUWH6OtxgVilv9vxhcAMgt8,893220
142
- inspect_ai/_view/www/dist/assets/index.js,sha256=Pt0kQNx43h8bkThAnFkf328gYQHCbOMmU5J53Pj5ZvY,2629589
141
+ inspect_ai/_view/www/dist/assets/index.css,sha256=LXlByh-4-A1aCndGppGI5pnGE1jiUHayZ9VDuPBarno,893396
142
+ inspect_ai/_view/www/dist/assets/index.js,sha256=cB5QrZSKv-815-Xr7xi8MZzkUdvGIFAn1PqtCiZ-X2g,2629550
143
+ inspect_ai/_view/www/node_modules/flatted/python/flatted.py,sha256=ke8FuEflns-WlphCcQ9CC0qJqWqX3zEEuak74o6rgE8,3879
144
+ inspect_ai/_view/www/node_modules/flatted/python/test.py,sha256=uTOn6HJd7KeY_PTRvvufv60dmvON3KWp3nnqACj8IlA,2129
143
145
  inspect_ai/_view/www/src/App.tsx,sha256=EvpnQfpWugx4PJivUN8GSUo8RXI4sHAFiIfacVXZ1Z0,28854
144
146
  inspect_ai/_view/www/src/AppErrorBoundary.tsx,sha256=RyhZWbIMZj1QeUOUUXh9hUFvq6LoDEoHuTY0giswmL0,1169
145
147
  inspect_ai/_view/www/src/constants.ts,sha256=UIxGbDscs61CcOQLQiW6MsZAU1uupSYNVLGxx2pp14A,1169
@@ -209,7 +211,7 @@ inspect_ai/_view/www/src/metadata/MetaDataView.module.css,sha256=-8AWTfZEMm7PEtS
209
211
  inspect_ai/_view/www/src/metadata/MetaDataView.tsx,sha256=sSPMHujF9X1f5kGL_wYfjCwoK44EFoN2UEIIvuMxL18,2212
210
212
  inspect_ai/_view/www/src/metadata/MetadataGrid.module.css,sha256=XuDbibxDp3ucmUw-pyjY5F0YUuzDfd5zyRSu3iJ-86I,203
211
213
  inspect_ai/_view/www/src/metadata/RenderedContent.module.css,sha256=Ji5KWs-f7J2g-OqZ41Rxr0DAOkHHTDL-w7KAjgWxeVo,134
212
- inspect_ai/_view/www/src/metadata/RenderedContent.tsx,sha256=X5aTMmrERy7dE19e_G5EUIlgxWmX1UNi8_gKUiOkcwY,6644
214
+ inspect_ai/_view/www/src/metadata/RenderedContent.tsx,sha256=vE-qwTQ8saA8v1bRJBDTzwWCHIYfjuiaHu7Q__Lj6e4,6458
213
215
  inspect_ai/_view/www/src/metadata/types.ts,sha256=Ss21MoobQ3SS1D3sbgQp_ab0ef4nD0MtTebUSllTWKs,345
214
216
  inspect_ai/_view/www/src/plan/DatasetDetailView.module.css,sha256=FxQ9APykN8fb9JPADCIeO6wq7F9YEmRll8P04Ay3k0o,32
215
217
  inspect_ai/_view/www/src/plan/DatasetDetailView.tsx,sha256=rfwFXStrKhmupTDTU51g6OEwtdTYwFiUalR6kcRv-Ms,902
@@ -226,7 +228,7 @@ inspect_ai/_view/www/src/samples/InlineSampleDisplay.module.css,sha256=cAigEhQV3
226
228
  inspect_ai/_view/www/src/samples/InlineSampleDisplay.tsx,sha256=HcYwnk0s89khE5jjIeLylvJyvgh8iNjYe8-E1O-HeYA,1421
227
229
  inspect_ai/_view/www/src/samples/SampleDialog.tsx,sha256=6J20w1ESDeifdeC1GJSkTlh79v3oY7b96vVrgXN4cYo,3075
228
230
  inspect_ai/_view/www/src/samples/SampleDisplay.module.css,sha256=mP-4LV47uWGHWkKMkXwIOOZHySrjsnsiYOi2XNAptYw,317
229
- inspect_ai/_view/www/src/samples/SampleDisplay.tsx,sha256=CiDVN0dXsN4hjnqp5WTUZNUbr9Mfcb8fLy1cdtrx--4,10137
231
+ inspect_ai/_view/www/src/samples/SampleDisplay.tsx,sha256=MdoOf8cKvY5vfvmMJ6tfpeEw8mQRIkH8iuPIAk6GpxA,10235
230
232
  inspect_ai/_view/www/src/samples/SampleSummaryView.module.css,sha256=ggaMIvv6LrExwB5U5yp0i0Wl9DIVaYbT0U0dX_VO3bc,314
231
233
  inspect_ai/_view/www/src/samples/SampleSummaryView.tsx,sha256=6v-6kOMblItnREGdAaftZvzr350lWA8UvOiPR7sj9Uw,4497
232
234
  inspect_ai/_view/www/src/samples/SamplesTools.tsx,sha256=adPNJnMag7gwD1AEFG8CjBUsuvmaTCqkL3LeUGKxOSc,1492
@@ -291,7 +293,7 @@ inspect_ai/_view/www/src/samples/sample-tools/sample-filter/SampleFilter.tsx,sha
291
293
  inspect_ai/_view/www/src/samples/sample-tools/sample-filter/completions.ts,sha256=Spo3X_ImMD5gUGexHWetgr3JlstbQnyYbZ0RNSqsgSI,10547
292
294
  inspect_ai/_view/www/src/samples/sample-tools/sample-filter/language.ts,sha256=OH0XXl_O2E9Q1MsVR0m9oGfTDVqPzohd9KPALiQGB2U,721
293
295
  inspect_ai/_view/www/src/samples/sample-tools/sample-filter/tokenize.ts,sha256=tD45vb1d-8XSV0RmGbdJijk92KuC555ksBsVD43uxCA,2802
294
- inspect_ai/_view/www/src/samples/scores/SampleScoreView.module.css,sha256=ykJAfxwO6ckexKYUEyfYTFPSN_GX4lgL5WzIdsl8cwI,606
296
+ inspect_ai/_view/www/src/samples/scores/SampleScoreView.module.css,sha256=OJY2qo_1xj7Z4eaeKqxJc0tHDJppTYwfi7MM69U8feI,749
295
297
  inspect_ai/_view/www/src/samples/scores/SampleScoreView.tsx,sha256=uOsYK5aLZ6E_5jFfu05LVMYCacGqEI3LblNcLckGTF4,4880
296
298
  inspect_ai/_view/www/src/samples/scores/SampleScores.module.css,sha256=jhwzLYwYRzEFhGqFZUYpzHOG3yDDY33rH14-ECgC9TQ,96
297
299
  inspect_ai/_view/www/src/samples/scores/SampleScores.tsx,sha256=xpO7ziC4WOj5ELq5Q_2arXlEwzuwyFVDGGGc3PkJAbI,979
@@ -372,7 +374,7 @@ inspect_ai/_view/www/src/workspace/navbar/Navbar.tsx,sha256=_3wp8SRFTE5F9YUJxZ4f
372
374
  inspect_ai/_view/www/src/workspace/navbar/PrimaryBar.module.css,sha256=6WFbRflx-OitSjKIJCXnhRo3KVZhYJCK35qsm6kGbX4,811
373
375
  inspect_ai/_view/www/src/workspace/navbar/PrimaryBar.tsx,sha256=T704YE_MkFamr-fbp0Ew0PUwik_9ZEKf6zOk9qWFZzU,3285
374
376
  inspect_ai/_view/www/src/workspace/navbar/ResultsPanel.module.css,sha256=-nGcKCV-RK-Fo21renL-t7GwyF1nsODfuRKHXakhwIc,1615
375
- inspect_ai/_view/www/src/workspace/navbar/ResultsPanel.tsx,sha256=JlCBzcNyRfGtD3lje2kj5Akec6BXQ1RnBCgFF6WSEA4,4541
377
+ inspect_ai/_view/www/src/workspace/navbar/ResultsPanel.tsx,sha256=vxoJsuK84X5uLLsgsGLPIywUZYYRZkmPnU9wmXMcfKU,4574
376
378
  inspect_ai/_view/www/src/workspace/navbar/SecondaryBar.module.css,sha256=c_nrfkns3HLqojutb9himHaKqGZlFQt375f81p6vWO4,353
377
379
  inspect_ai/_view/www/src/workspace/navbar/SecondaryBar.tsx,sha256=lasEuHmHgS-O4yPhXPsyMR9jG4T8fM5x9NRLHX5bhpc,5090
378
380
  inspect_ai/_view/www/src/workspace/navbar/StatusPanel.module.css,sha256=5jwAeGZ14LT66dql80qTu2nig75kk9Ethp4ftHW6Zsw,290
@@ -611,15 +613,15 @@ inspect_ai/util/_sandbox/self_check.py,sha256=YaonS0VQyutDpOlHchGhrIUm13juUzEkrk
611
613
  inspect_ai/util/_sandbox/service.py,sha256=2os7W8NYBDcaBoaHVfZ1YrI9hvldksmiwqkUYrCRCPo,11258
612
614
  inspect_ai/util/_sandbox/docker/cleanup.py,sha256=MK6UlADcWtTDotppeVJga2ibf9Ud-e4V-5ReoNbmhqg,4793
613
615
  inspect_ai/util/_sandbox/docker/compose.py,sha256=g98fwb33EsQQDHKEUYic8tPmi51IA7v3aWm3YoEBEgA,11904
614
- inspect_ai/util/_sandbox/docker/config.py,sha256=eHZIbd-t1oM8D6zTWzJJUMWta1MpTtyzaM7W5o982VM,2831
616
+ inspect_ai/util/_sandbox/docker/config.py,sha256=I2sxkN2mTS3kXoAGtJ2w7yuhMoacECgkdxiXftlAvKA,2918
615
617
  inspect_ai/util/_sandbox/docker/docker.py,sha256=Dhp2-H-CFPvHD0BlDNTZZtnXj0Jh9_IZjLl7qoyUaD4,17195
616
618
  inspect_ai/util/_sandbox/docker/internal.py,sha256=fATyk2pdtjSl-D0VPT4dmkXV-gOc5HrPH0EQDW4IAJY,1446
617
619
  inspect_ai/util/_sandbox/docker/prereqs.py,sha256=0j6_OauBBnVlpBleADcZavIAAQZy4WewVjbRn9c0stg,3355
618
620
  inspect_ai/util/_sandbox/docker/service.py,sha256=hhHIWH1VDFLwehdGd19aUBD_VKfDO3GCPxpw1HSwVQk,2437
619
- inspect_ai/util/_sandbox/docker/util.py,sha256=pSPsRGymrTmTnEUHiHoQSNqeurPP1mL5kB-105O6EWo,2794
620
- inspect_ai-0.3.64.dist-info/LICENSE,sha256=xZPCr8gTiFIerrA_DRpLAbw-UUftnLFsHxKeW-NTtq8,1081
621
- inspect_ai-0.3.64.dist-info/METADATA,sha256=RBbzTWGJBABdpSQzj5LGGuLGNt8q60oGxa1NnzFUwAU,4742
622
- inspect_ai-0.3.64.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
623
- inspect_ai-0.3.64.dist-info/entry_points.txt,sha256=WGGLmzTzDWLzYfiyovSY6oEKuf-gqzSDNOb5V-hk3fM,54
624
- inspect_ai-0.3.64.dist-info/top_level.txt,sha256=Tp3za30CHXJEKLk8xLe9qGsW4pBzJpEIOMHOHNCXiVo,11
625
- inspect_ai-0.3.64.dist-info/RECORD,,
621
+ inspect_ai/util/_sandbox/docker/util.py,sha256=CuYrt9iyLjPSVDEs_oGTas8wAwMwQc_45dZa2g3E4cY,2847
622
+ inspect_ai-0.3.66.dist-info/LICENSE,sha256=xZPCr8gTiFIerrA_DRpLAbw-UUftnLFsHxKeW-NTtq8,1081
623
+ inspect_ai-0.3.66.dist-info/METADATA,sha256=drMcoYJASKO4aBPr7_5b_wRXWNa7ZTFAZBIvQnLnxVY,4742
624
+ inspect_ai-0.3.66.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
625
+ inspect_ai-0.3.66.dist-info/entry_points.txt,sha256=WGGLmzTzDWLzYfiyovSY6oEKuf-gqzSDNOb5V-hk3fM,54
626
+ inspect_ai-0.3.66.dist-info/top_level.txt,sha256=Tp3za30CHXJEKLk8xLe9qGsW4pBzJpEIOMHOHNCXiVo,11
627
+ inspect_ai-0.3.66.dist-info/RECORD,,