Skip to content

Commit d31994b

Browse files
authored
Merge pull request #160 from rycerzes/feature-standardize-env
Standardize Environment Directory Structure #145
2 parents 30e7046 + fc2338a commit d31994b

File tree

30 files changed

+4396
-253
lines changed

30 files changed

+4396
-253
lines changed

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,17 @@ Desktop.ini
9595
*claude*
9696
*Claude*
9797
*CLAUDE*
98+
99+
# OpenEnv-specific
100+
# Environment outputs (logs, evaluations, etc.)
101+
**/outputs/
102+
outputs/
103+
104+
# Generated requirements files from pyproject.toml
105+
**/server/requirements.txt.generated
106+
107+
# UV root lock file (env lock files should be committed)
108+
/uv.lock
109+
.uv/
110+
111+
*.backup*/

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,45 @@ my_env/
134134
├── client.py # Implement YourEnv(HTTPEnvClient)
135135
├── README.md # Document your environment
136136
├── openenv.yaml # Environment manifest
137+
├── pyproject.toml # Dependencies and package configuration
138+
├── outputs/ # Runtime outputs (logs, evals) - gitignored
139+
│ ├── logs/
140+
│ └── evals/
137141
└── server/
138142
├── your_environment.py # Implement YourEnvironment(Environment)
139143
├── app.py # Create FastAPI app
144+
├── requirements.txt # Dependencies for Docker (can be generated)
140145
└── Dockerfile # Define container image
141146
```
142147

148+
#### Dependency Management
149+
150+
OpenEnv uses `pyproject.toml` as the primary dependency specification:
151+
152+
- **Environment-level `pyproject.toml`**: Each environment defines its own dependencies
153+
- **Root-level `pyproject.toml`**: Contains shared core dependencies (fastapi, pydantic, uvicorn)
154+
- **Server `requirements.txt`**: Can be auto-generated from `pyproject.toml` for Docker builds
155+
156+
**Development Workflow:**
157+
158+
```bash
159+
# Install environment in editable mode
160+
cd my_env
161+
pip install -e .
162+
163+
# Or using uv (faster)
164+
uv pip install -e .
165+
166+
# Run server locally without Docker
167+
uv run server --host 0.0.0.0 --port 8000
168+
```
169+
170+
**Benefits:**
171+
-**Client-side extensions**: Modify client classes locally without repo changes
172+
-**Better dependency management**: Clear separation between environments
173+
-**Flexible workflows**: Use pip, uv, or Docker for different scenarios
174+
-**CI/CD ready**: Automated dependency generation and validation
175+
143176
See [`src/envs/README.md`](src/envs/README.md) for a complete guide on building environments.
144177

145178
### For Environment Users

pyproject.toml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,25 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "openenv"
7-
version = "0.1.0"
7+
version = "0.1.1"
8+
description = "A unified framework for reinforcement learning environments"
9+
readme = "README.md"
810
requires-python = ">=3.10"
911
dependencies = [
10-
"torch>=1.9.0",
11-
"numpy>=1.19.0",
12-
"requests>=2.25.0",
12+
# Core shared dependencies - minimal set required for all environments
13+
# Heavy dependencies (torch, numpy, smolagents, etc.) should be in
14+
# individual environment pyproject.toml files
1315
"fastapi>=0.104.0",
16+
"pydantic>=2.0.0",
1417
"uvicorn>=0.24.0",
15-
"smolagents>=1.22.0,<2",
18+
"requests>=2.25.0",
19+
# CLI dependencies
1620
"typer>=0.9.0",
1721
"rich>=13.0.0",
1822
"pyyaml>=6.0",
19-
"huggingface_hub>=0.20.0"
23+
"huggingface_hub>=0.20.0",
24+
"tomli>=2.3.0",
25+
"tomli-w>=1.2.0",
2026
]
2127

2228
[project.scripts]

0 commit comments

Comments
 (0)