-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
87 lines (73 loc) · 3.85 KB
/
pyproject.toml
File metadata and controls
87 lines (73 loc) · 3.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# ─────────────────────────────────────────────────────────────────────────────
# SQL Query Optimizer Environment
# Meta OpenEnv Hackathon
# ─────────────────────────────────────────────────────────────────────────────
[build-system]
requires = ["setuptools>=45", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "openenv-sql-optimizer"
version = "0.1.0"
description = "RL environment that teaches an agent to rewrite slow SQL queries. Connects to any Postgres database at runtime — no schema knowledge required upfront."
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
# ── OpenEnv core ──────────────────────────────────────────────────────────
# Provides: Environment base class, EnvClient, FastAPI server factory
"openenv-core[core]>=0.2.2",
# ── Postgres driver ───────────────────────────────────────────────────────
# psycopg2-binary includes the C library statically linked.
# No system libpq needed — works inside the Docker container out of the box.
"psycopg2-binary>=2.9.0",
# ── SQL parser and rewriter ───────────────────────────────────────────────
# Parses SQL into an AST, applies structural rewrites, serializes back.
# Supports postgres dialect, handles hints, CTEs, subqueries, joins.
"sqlglot>=23.0.0",
# ── Web server ────────────────────────────────────────────────────────────
"fastapi>=0.100.0",
"uvicorn[standard]>=0.20.0",
# ── Validation ────────────────────────────────────────────────────────────
"pydantic>=2.0.0",
]
[project.optional-dependencies]
# Install with: uv pip install -e ".[dev]"
dev = [
"pytest>=8.0.0",
"pytest-cov>=4.0.0",
"pytest-asyncio>=0.21.0",
"httpx>=0.24.0", # for testing FastAPI endpoints
"black>=23.0.0", # formatter
"ruff>=0.1.0", # linter
]
# Install with: uv pip install -e ".[train]"
# Everything needed to run a GRPO training loop against this environment
train = [
"torch>=2.0.0",
"transformers>=4.40.0",
"trl>=0.8.0",
"datasets>=2.0.0",
"accelerate>=0.20.0",
]
[project.scripts]
# Start the environment server:
# uv run server
server = "sql_optimizer.server.app:main"
[tool.setuptools]
include-package-data = true
packages = [
"sql_optimizer",
"sql_optimizer.server",
]
[tool.setuptools.package-dir]
"sql_optimizer" = "sql_optimizer"
"sql_optimizer.server" = "sql_optimizer/server"
# ── Linting ───────────────────────────────────────────────────────────────────
[tool.ruff]
line-length = 100
target-version = "py310"
select = ["E", "F", "W", "I"]
ignore = ["E501"]
# ── Testing ───────────────────────────────────────────────────────────────────
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"