Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Codespaces: Use pip install instead of creating new conda env (#291)

Kilian Lieretbb27f4fd88af
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 096e5c45..d68ddf02 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -9,7 +9,8 @@
"ms-azuretools.vscode-docker",
"ms-toolsai.jupyter"
],
- "onCreateCommand": "sudo usermod -aG docker vscode && sudo chmod 666 /var/run/docker.sock && docker pull sweagent/swe-agent && conda env create -f environment.yml && conda init && echo '\nconda activate swe-agent\n' >> ~/.bashrc",
+ "onCreateCommand": "./.devcontainer/oncreate.sh",
+ "postCreateCommand": "./.devcontainer/postcreate.sh",
"features": {
"docker-in-docker": "latest"
},
diff --git a/.devcontainer/oncreate.sh b/.devcontainer/oncreate.sh
new file mode 100755
index 00000000..3992c4e0
--- /dev/null
+++ b/.devcontainer/oncreate.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+set -x
+
+sudo usermod -aG docker vscode
+sudo chmod 666 /var/run/docker.sock
+pip install -e '.'
diff --git a/.devcontainer/postcreate.sh b/.devcontainer/postcreate.sh
new file mode 100755
index 00000000..c2a94da6
--- /dev/null
+++ b/.devcontainer/postcreate.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+set -x
+
+pip install -e '.'
+docker pull sweagent/swe-agent