mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-04-29 03:00:45 -04:00
Compare commits
16 Commits
openhands-
...
ad/create-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13c8ab19d5 | ||
|
|
b90c464c39 | ||
|
|
a143242c37 | ||
|
|
5bb859970b | ||
|
|
1877fe9b91 | ||
|
|
7817f18744 | ||
|
|
a03b614447 | ||
|
|
3dad4e4f2e | ||
|
|
6361b30767 | ||
|
|
9fc5ebbf73 | ||
|
|
b8c9e314e1 | ||
|
|
5b247b9fe3 | ||
|
|
2d638f0540 | ||
|
|
8217739c31 | ||
|
|
834f3aa088 | ||
|
|
007051b453 |
17
.github/workflows/run-tests.yml
vendored
Normal file
17
.github/workflows/run-tests.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
name: Run Tests
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- name: Run tests
|
||||
run: |
|
||||
make build
|
||||
poetry run pytest ./tests
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -100,7 +100,7 @@ ipython_config.py
|
||||
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||
# commonly ignored for libraries.
|
||||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
||||
#poetry.lock
|
||||
# poetry.lock
|
||||
|
||||
# pdm
|
||||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
||||
@@ -128,6 +128,7 @@ venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
*venv/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
|
||||
28
Makefile
28
Makefile
@@ -8,6 +8,7 @@ FRONTEND_PORT = 3001
|
||||
DEFAULT_WORKSPACE_DIR = "./workspace"
|
||||
DEFAULT_MODEL = "gpt-4-0125-preview"
|
||||
CONFIG_FILE = config.toml
|
||||
PRECOMMIT_CONFIG_PATH = "./dev_config/python/.pre-commit-config.yaml"
|
||||
|
||||
# Build
|
||||
build:
|
||||
@@ -15,8 +16,11 @@ build:
|
||||
@echo "Pulling Docker image..."
|
||||
@docker pull $(DOCKER_IMAGE)
|
||||
@echo "Installing Python dependencies..."
|
||||
@python -m pip install pipenv
|
||||
@python -m pipenv install -v
|
||||
@curl -sSL https://install.python-poetry.org | python3 -
|
||||
@poetry install --without evaluation
|
||||
@echo "Activating Poetry shell..."
|
||||
@echo "Installing pre-commit hooks..."
|
||||
@poetry run pre-commit install --config $(PRECOMMIT_CONFIG_PATH)
|
||||
@echo "Setting up frontend environment..."
|
||||
@echo "Detect Node.js version..."
|
||||
@cd frontend && node ./scripts/detect-node-version.js
|
||||
@@ -27,10 +31,16 @@ build:
|
||||
@which corepack > /dev/null || (echo "Installing corepack..." && npm install -g corepack)
|
||||
@cd frontend && corepack enable && pnpm install && pnpm run make-i18n
|
||||
|
||||
# Build Evaluation
|
||||
build-eval:
|
||||
@echo "Building evaluation dependencies..."
|
||||
@poetry install --only evaluation
|
||||
@echo "Evaluation dependencies built successfully."
|
||||
|
||||
# Start backend
|
||||
start-backend:
|
||||
@echo "Starting backend..."
|
||||
@python -m pipenv run uvicorn opendevin.server.listen:app --port $(BACKEND_PORT)
|
||||
@poetry run uvicorn opendevin.server.listen:app --port $(BACKEND_PORT)
|
||||
|
||||
# Start frontend
|
||||
start-frontend:
|
||||
@@ -40,15 +50,15 @@ start-frontend:
|
||||
# Run the app
|
||||
run:
|
||||
@echo "Running the app..."
|
||||
@if [ "$(OS)" == "Windows_NT" ]; then \
|
||||
@if [ "$(OS)" = "Windows_NT" ]; then \
|
||||
echo "`make run` is not supported on Windows. Please run `make start-frontend` and `make start-backend` separately."; \
|
||||
exit 1; \
|
||||
fi
|
||||
@mkdir -p logs
|
||||
@rm -f logs/pipe
|
||||
@mkfifo logs/pipe
|
||||
@cat logs/pipe | (make start-backend) &
|
||||
@echo 'test' | tee logs/pipe | (make start-frontend)
|
||||
@poetry run nohup uvicorn opendevin.server.listen:app --port $(BACKEND_PORT) > logs/backend_$(shell date +'%Y%m%d_%H%M%S').log 2>&1 &
|
||||
@echo "Waiting for the backend to start..."
|
||||
@until nc -z localhost $(BACKEND_PORT); do sleep 0.1; done
|
||||
@cd frontend && npm run start -- --port $(FRONTEND_PORT)
|
||||
|
||||
# Setup config.toml
|
||||
setup-config:
|
||||
@@ -94,4 +104,4 @@ help:
|
||||
@echo " help - Display this help message, providing information on available targets."
|
||||
|
||||
# Phony targets
|
||||
.PHONY: install start-backend start-frontend run setup-config help
|
||||
.PHONY: build build-eval start-backend start-frontend run setup-config help
|
||||
|
||||
32
Pipfile
32
Pipfile
@@ -1,32 +0,0 @@
|
||||
[[source]]
|
||||
url = "https://pypi.org/simple"
|
||||
verify_ssl = true
|
||||
name = "pypi"
|
||||
|
||||
[packages]
|
||||
datasets = "*"
|
||||
pandas = "*"
|
||||
litellm = "*"
|
||||
termcolor = "*"
|
||||
seaborn = "*"
|
||||
docker = "*"
|
||||
fastapi = "*"
|
||||
uvicorn = {extras = ["standard"], version = "*"}
|
||||
ruff = "*"
|
||||
mypy = "*"
|
||||
llama-index = "*"
|
||||
llama-index-vector-stores-chroma = "*"
|
||||
chromadb = "*"
|
||||
llama-index-embeddings-huggingface = "*"
|
||||
llama-index-embeddings-azure-openai = "*"
|
||||
llama-index-embeddings-ollama = "*"
|
||||
google-generativeai = "*"
|
||||
toml = "*"
|
||||
json_repair = "*"
|
||||
numpy = "*"
|
||||
playwright = "*"
|
||||
|
||||
[dev-packages]
|
||||
|
||||
[requires]
|
||||
python_version = "3.11"
|
||||
3854
Pipfile.lock
generated
3854
Pipfile.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,38 +0,0 @@
|
||||
[[source]]
|
||||
url = "https://pypi.org/simple"
|
||||
verify_ssl = true
|
||||
name = "pypi"
|
||||
|
||||
[[source]]
|
||||
url = "https://download.pytorch.org/whl/cpu"
|
||||
verify_ssl = true
|
||||
name = "pytorch"
|
||||
|
||||
[packages]
|
||||
torch = {version = "*", index = "pytorch"}
|
||||
datasets = "*"
|
||||
pandas = "*"
|
||||
litellm = "*"
|
||||
termcolor = "*"
|
||||
seaborn = "*"
|
||||
docker = "*"
|
||||
fastapi = "*"
|
||||
uvicorn = {extras = ["standard"], version = "*"}
|
||||
ruff = "*"
|
||||
mypy = "*"
|
||||
llama-index = "*"
|
||||
llama-index-vector-stores-chroma = "*"
|
||||
chromadb = "*"
|
||||
llama-index-embeddings-huggingface = "*"
|
||||
llama-index-embeddings-azure-openai = "*"
|
||||
llama-index-embeddings-ollama = "*"
|
||||
google-generativeai = "*"
|
||||
toml = "*"
|
||||
json_repair = "*"
|
||||
numpy = "*"
|
||||
playwright = "*"
|
||||
|
||||
[dev-packages]
|
||||
|
||||
[requires]
|
||||
python_version = "3.11"
|
||||
@@ -8,4 +8,4 @@ warn_redundant_casts = True
|
||||
no_implicit_optional = True
|
||||
strict_optional = True
|
||||
|
||||
exclude = agenthub/monologue_agent/regression
|
||||
exclude = agenthub/monologue_agent/regression
|
||||
|
||||
1640
frontend/package-lock.json
generated
1640
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
import os
|
||||
import toml
|
||||
import toml # type: ignore
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
@@ -34,12 +34,14 @@ for key, value in config.items():
|
||||
config[key] = tomlConfig[key]
|
||||
|
||||
|
||||
|
||||
def _get(key: str, default):
|
||||
value = config.get(key, default)
|
||||
if not value:
|
||||
value = os.environ.get(key, default)
|
||||
return value
|
||||
|
||||
|
||||
def get_or_error(key: str):
|
||||
"""
|
||||
Get a key from the config, or raise an error if it doesn't exist.
|
||||
@@ -49,12 +51,14 @@ def get_or_error(key: str):
|
||||
raise KeyError(f"Please set '{key}' in `config.toml` or `.env`.")
|
||||
return value
|
||||
|
||||
|
||||
def get_or_default(key: str, default):
|
||||
"""
|
||||
Get a key from the config, or return a default value if it doesn't exist.
|
||||
"""
|
||||
return _get(key, default)
|
||||
|
||||
|
||||
def get_or_none(key: str):
|
||||
"""
|
||||
Get a key from the config, or return None if it doesn't exist.
|
||||
|
||||
5814
poetry.lock
generated
Normal file
5814
poetry.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
48
pyproject.toml
Normal file
48
pyproject.toml
Normal file
@@ -0,0 +1,48 @@
|
||||
[tool.poetry]
|
||||
name = "opendevin"
|
||||
version = "0.1.0"
|
||||
description = "OpenDevin: Code Less, Make More"
|
||||
authors = ["OpenDevin"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/OpenDevin/OpenDevin"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.11"
|
||||
datasets = "*"
|
||||
pandas = "*"
|
||||
litellm = "*"
|
||||
termcolor = "*"
|
||||
seaborn = "*"
|
||||
docker = "*"
|
||||
fastapi = "*"
|
||||
toml = "*"
|
||||
uvicorn = "*"
|
||||
types-toml = "*"
|
||||
numpy = "*"
|
||||
json-repair = "*"
|
||||
playwright = "*"
|
||||
|
||||
[tool.poetry.group.llama-index.dependencies]
|
||||
llama-index = "*"
|
||||
llama-index-vector-stores-chroma = "*"
|
||||
chromadb = "*"
|
||||
llama-index-embeddings-huggingface = "*"
|
||||
llama-index-embeddings-azure-openai = "*"
|
||||
llama-index-embeddings-ollama = "*"
|
||||
pymupdfb = "*"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
ruff = "*"
|
||||
mypy = "*"
|
||||
pre-commit = "*"
|
||||
|
||||
[tool.poetry.group.test.dependencies]
|
||||
pytest = "*"
|
||||
|
||||
[tool.poetry.group.evaluation.dependencies]
|
||||
torch = "*"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
Reference in New Issue
Block a user