Skip to content

Commit 9f288f7

Browse files
committed
Merge remote-tracking branch 'upstream/main' into cf-2
2 parents c10d3e5 + ab7487c commit 9f288f7

File tree

906 files changed

+114311
-82038
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

906 files changed

+114311
-82038
lines changed

.github/dependabot.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
version: 2
22
updates:
3-
- package-ecosystem: pip
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
time: "13:00"
8-
groups:
9-
python-packages:
10-
patterns:
11-
- "*"
3+
- package-ecosystem: pip
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "13:00"
8+
groups:
9+
python-packages:
10+
patterns:
11+
- "*"
12+
ignore:
13+
- dependency-name: "quarto-cli"
14+
versions: [">=1.6.0"]
15+
- dependency-name: "ruff"
16+
versions: [">=0.9.5"]
17+
- dependency-name: "textual"
18+
versions: [">=2.0.0"]
19+
- dependency-name: "fsspec"
20+
versions: [">=2024.12.0"]

.github/workflows/build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ jobs:
5151
run: |
5252
mypy .
5353
54+
pre-commit:
55+
runs-on: ubuntu-latest
56+
env:
57+
SKIP: "ruff"
58+
steps:
59+
- uses: actions/checkout@v4
60+
- uses: actions/setup-python@v5
61+
with:
62+
python-version: "3.11"
63+
cache: pip
64+
- uses: pre-commit/[email protected]
65+
5466
test:
5567
runs-on: ubuntu-latest
5668
strategy:

.github/workflows/docker.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Build and Push Image to Docker Hub
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
image:
7+
description: Image to build
8+
required: true
9+
type: choice
10+
options:
11+
- inspect-computer-tool
12+
- inspect-web-browser-tool
13+
- inspect-tool-support
14+
tag:
15+
description: Tag to assign to the image
16+
required: true
17+
type: string
18+
default: latest
19+
platforms:
20+
description: Target platforms (comma-separated list)
21+
required: true
22+
type: string
23+
default: linux/amd64,linux/arm64
24+
push:
25+
description: Push the image to Docker Hub
26+
required: true
27+
type: boolean
28+
default: true
29+
org:
30+
description: Docker Hub organization
31+
required: true
32+
type: string
33+
default: aisiuk
34+
35+
jobs:
36+
build-and-push:
37+
runs-on: ubuntu-latest
38+
environment: docker
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
- name: Set build context path and image name
43+
run: |
44+
if [[ "${{ github.event.inputs.image }}" == "inspect-computer-tool" ]]; then
45+
echo "BUILD_CONTEXT=src/inspect_ai/tool/_tools/_computer/_resources" >> $GITHUB_ENV
46+
elif [[ "${{ github.event.inputs.image }}" == "inspect-web-browser-tool" ]]; then
47+
echo "BUILD_CONTEXT=src/inspect_ai/tool/_tools/_web_browser/_resources" >> $GITHUB_ENV
48+
elif [[ "${{ github.event.inputs.image }}" == "inspect-tool-support" ]]; then
49+
echo "BUILD_CONTEXT=src/inspect_tool_support" >> $GITHUB_ENV
50+
else
51+
echo "Invalid image name '${{ github.event.inputs.image }}'"
52+
exit 1
53+
fi
54+
- name: Login to DockerHub
55+
uses: docker/login-action@v2
56+
with:
57+
username: ${{ secrets.DOCKERHUB_USERNAME }}
58+
password: ${{ secrets.DOCKERHUB_TOKEN }}
59+
- name: Set up QEMU
60+
uses: docker/setup-qemu-action@v2
61+
with:
62+
platforms: arm64,amd64
63+
- name: Set up Docker Buildx
64+
id: buildx
65+
uses: docker/setup-buildx-action@v2
66+
with:
67+
install: true
68+
- name: Build and (optionally) push multi-arch image
69+
uses: docker/build-push-action@v4
70+
with:
71+
context: ${{ env.BUILD_CONTEXT }}
72+
push: ${{ github.event.inputs.push }}
73+
platforms: ${{ github.event.inputs.platforms }}
74+
tags: ${{ github.event.inputs.org }}/${{ github.event.inputs.image }}:${{ github.event.inputs.tag }}
75+
cache-from: type=gha
76+
cache-to: type=gha,mode=max

.pre-commit-config.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
3-
# This should be the _latest_ version of python supported by us
4-
default_language_version:
5-
python: python3.11
63
repos:
74
- repo: https://github.com/astral-sh/ruff-pre-commit
8-
rev: v0.9.3
5+
rev: v0.9.6
96
hooks:
107
# Run the linter.
118
- id: ruff
@@ -17,8 +14,9 @@ repos:
1714
hooks:
1815
- id: check-added-large-files
1916
- id: check-json
17+
# The following are JSONC files.
18+
exclude: '(^\.vscode/|^tools/vscode/|jsconfig\.json$|tsconfig\.json$)'
2019
- id: check-yaml
2120
- id: debug-statements
2221
- id: detect-private-key
23-
- id: end-of-file-fixer
2422
- id: requirements-txt-fixer

.pylintrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[MASTER]
2+
; R - Refactorings
3+
; C - Convention
4+
; W - Warning
5+
; E - Error
6+
enable=E
7+
; We are starting conservatively disabling non-errors and a handful of currently noisy E's
8+
disable=R,W,C,E0401,E1101,E0611,E1128,E0606
9+
score=no

.vscode/launch.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python Debugger: Module",
9+
"type": "debugpy",
10+
"request": "launch",
11+
"module": "inspect_ai",
12+
"args": "${input:argsPrompt}",
13+
"cwd": "${workspaceFolder}/src"
14+
}
15+
],
16+
"inputs": [
17+
{
18+
"id": "argsPrompt",
19+
"type": "promptString",
20+
"description": "Enter arguments for the module",
21+
"default": ""
22+
}
23+
]
24+
}

0 commit comments

Comments
 (0)