Skip to content

πŸ™Œ OpenHands: AI-Driven Development

feat: Add dev container (#8589)

Kent Johnson35d2281717c1
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 0000000000..baa34e541d
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,15 @@
+// For format details, see: https://aka.ms/devcontainer.json
+{
+ "name": "Python 3",
+ // Documentation for this image:
+ // - https://github.com/devcontainers/templates/tree/main/src/python
+ // - https://github.com/microsoft/vscode-remote-try-python
+ // - https://hub.docker.com/r/microsoft/devcontainers-python
+ "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
+ "features": {
+ "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
+ "ghcr.io/devcontainers-extra/features/poetry:2": {},
+ "ghcr.io/devcontainers/features/node:1": {},
+ },
+ "postCreateCommand": ".devcontainer/setup.sh",
+}
diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh
new file mode 100644
index 0000000000..c4035508ef
--- /dev/null
+++ b/.devcontainer/setup.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# Install `nc`
+sudo apt update && sudo apt install netcat -y
+
+# Do common setup tasks
+source .openhands/setup.sh
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..25de61b6a4
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,5 @@
+[*]
+# force *nix line endings so files don't look modified in container run from Windows clone
+end_of_line = lf
+trim_trailing_whitespace = true
+insert_final_newline = true
diff --git a/.gitattributes b/.gitattributes
index 5be91f972c..0a3e3b5cb8 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1 +1,7 @@
*.ipynb linguist-vendored
+
+# force *nix line endings so files don't look modified in container run from Windows clone
+* text eol=lf
+# Git incorrectly thinks some media is text
+*.png -text
+*.mp4 -text
diff --git a/.gitignore b/.gitignore
index b88b0cb607..88f989dfb2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -161,9 +161,16 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
-.vscode/
.cursorignore
+# VS Code: Ignore all but certain files that specify repo-specific settings.
+# https://stackoverflow.com/questions/32964920/should-i-commit-the-vscode-folder-to-source-control
+.vscode/**/*
+!.vscode/extensions.json
+!.vscode/launch.json
+!.vscode/settings.json
+!.vscode/tasks.json
+
# evaluation
evaluation/evaluation_outputs
evaluation/outputs
diff --git a/.openhands/setup.sh b/.openhands/setup.sh
index 7fde909923..f2c29926d3 100755
--- a/.openhands/setup.sh
+++ b/.openhands/setup.sh
@@ -9,4 +9,5 @@ python -m pip install pre-commit
if [ -d ".git" ]; then
echo "Installing pre-commit hooks..."
pre-commit install
+ make install-pre-commit-hooks
fi
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000000..70599b8520
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,6 @@
+{
+ // force *nix line endings so files don't look modified in container run from Windows clone
+ "files.eol": "\n",
+ "files.trimTrailingWhitespace": true,
+ "files.insertFinalNewline": true,
+}