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]

Setup: do not duplicate requirements (#300)

Kilian Lieretad5826886871
diff --git a/Dockerfile b/Dockerfile
index b5c150ae..fd8eaef6 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,9 +3,6 @@ FROM python:3.9
# Set the working directory
WORKDIR /app
-# Install Python dependencies
-RUN pip install anthropic[bedrock] config datasets docker gymnasium numpy openai pandas rich rich_argparse ruamel.yaml swebench tenacity unidiff simple-parsing together ollama
-
# Install Docker CLI using the official Docker installation script
RUN curl -fsSL https://get.docker.com -o get-docker.sh && \
sh get-docker.sh
@@ -14,3 +11,5 @@ RUN curl -fsSL https://get.docker.com -o get-docker.sh && \
# Do this last to take advantage of the docker layer mechanism
COPY . /app
+# Install Python dependencies
+RUN pip install .
diff --git a/environment.yml b/environment.yml
index ee255ff5..a7d097f6 100644
--- a/environment.yml
+++ b/environment.yml
@@ -3,20 +3,4 @@ dependencies:
- python=3.9
- pip
- pip:
- - anthropic[bedrock]
- - config
- - datasets
- - docker
- - gymnasium
- - numpy
- - openai>=1.0
- - pandas
- - rich
- - ruamel.yaml
- - swebench>=1.0.1
- - tenacity
- - unidiff
- - simple-parsing
- - together>=1.1.0 # Versions of together below 1.1.0 are not compatible. see https://github.com/princeton-nlp/SWE-agent/issues/135
- - ollama
- - rich-argparse
+ - -r requirements.txt
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index b79b4103..ac07a134 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta" # If not defined, then legacy behavior
[project]
name = "sweagent"
-dynamic = ["version"]
+dynamic = ["version", "dependencies"]
description = "The official SWE-agent package - an open source Agent Computer Interface for running language models as software engineers."
readme = "README.md"
requires-python = ">=3.9"
@@ -36,31 +36,12 @@ classifiers = [
"Programming Language :: Python :: 3 :: Only",
]
-dependencies = [
- "anthropic",
- "config",
- "datasets",
- "docker",
- "gymnasium",
- "numpy",
- "openai>=1.0",
- "pandas",
- "rich",
- "ollama",
- "ruamel.yaml",
- "simple-parsing",
- "swebench>=1.0.1",
- "tenacity",
- "together",
- "unidiff",
- "rich-argparse"
-]
-
[tool.setuptools]
include-package-data = true
[tool.setuptools.dynamic]
version = {attr = "sweagent.__version__"}
+dependencies = {file = ["requirements.txt"]}
[tool.setuptools.packages.find]
where = ["."]
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 00000000..740bf740
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,18 @@
+anthropic[bedrock]
+config
+datasets
+docker
+gymnasium
+numpy
+openai>=1.0
+pandas
+rich
+ruamel.yaml
+swebench>=1.0.1
+tenacity
+unidiff
+simple-parsing
+# Versions of together below 1.1.0 are not compatible. see https://github.com/princeton-nlp/SWE-agent/issues/135
+together>=1.1.0
+ollama
+rich-argparse
\ No newline at end of file