Skip to content

Secure, Fast, and Extensible Sandbox runtime for AI agents.

4.0 KB
Raw Blame
# Copyright 2025 The OpenSandbox Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "opensandbox"
dynamic = ["version"]
description = "OpenSandbox Python SDK - Secure, isolated execution environments"
authors = [
    { name = "OpenSandbox Team", email = "[email protected]" }
]
license = { file = "LICENSE" }
readme = "README.md"
requires-python = ">=3.10"
keywords = ["sandbox", "code-execution", "docker", "security", "sdk", "opensandbox"]
classifiers = [
    "Development Status :: 3 - Alpha",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: Apache Software License",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3 :: Only",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Topic :: Software Development :: Libraries",
    "Typing :: Typed",
]
dependencies = [
    "pydantic>=2.4.2,<3.0",
    "python-dateutil>=2.8.2,<3.0",
    "attrs>=21.3.0",
    "httpx>=0.27.0,<1.0",
    "httpcore>=1.0.0,<2.0",
    "httpx-sse>=0.4.3,<0.5",
    "opentelemetry-api>=1.20,<2.0",
]

[project.optional-dependencies]
pool-redis = [
    "redis>=5.0,<6.0",
    "pyjwt>=2.14.0",
]

[project.urls]
Homepage = "https://open-sandbox.ai"
Repository = "https://github.com/opensandbox-group/OpenSandbox"
Documentation = "https://open-sandbox.ai"
Issues = "https://github.com/opensandbox-group/OpenSandbox/issues"

[tool.hatch.version]
source = "vcs"

[tool.hatch.version.raw-options]
# This package is in a subdirectory; explicitly point setuptools-scm at the git root.
root = "../../.."
tag_regex = "^release-(?P<version>\\d+\\.\\d+\\.\\d+(?:[\\.\\w\\+\\-]*)?)$"
git_describe_command = 'git describe --dirty --tags --long --match "release-*"'
fallback_version = "0.1.16"

[tool.hatch.build]
include = [
    "LICENSE",
    "src/**/py.typed",
    "src/opensandbox"
]

[tool.hatch.build.targets.wheel]
packages = ["src/opensandbox"]

[tool.ruff]
target-version = "py310"
line-length = 88
exclude = [
    "src/opensandbox/api/**",
]

[tool.ruff.lint]
select = [
    "E",  # pycodestyle errors
    "W",  # pycodestyle warnings
    "F",  # pyflakes
    "I",  # isort
    "B",  # flake8-bugbear
    "C4", # flake8-comprehensions
    "UP", # pyupgrade
]
ignore = [
    "E501", # line too long, handled by formatter
    "B008", # do not perform function calls in argument defaults
    "C901", # too complex
]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]

[tool.pyright]
typeCheckingMode = "standard"
pythonVersion = "3.10"
pythonPlatform = "All"

include = ["src", "tests/typecheck"]

exclude = [
    "**/node_modules",
    "**/__pycache__",
    "src/opensandbox/api/**",
]

venvPath = "."
venv = ".venv"

reportMissingImports = true
reportMissingTypeStubs = false

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra -q --strict-markers --strict-config"
testpaths = [
    "tests",
]
python_files = [
    "test_*.py",
    "*_test.py",
]
asyncio_mode = "auto"

[tool.uv]
constraint-dependencies = [
    "pyjwt>=2.14.0",
]

[tool.coverage.run]
source = ["src"]
branch = true

[dependency-groups]
dev = [
    "redis>=5.0,<6.0",
    "pytest>=7.0.0",
    "pytest-asyncio>=0.21.0",
    "pytest-cov>=4.0.0",
    "ruff>=0.14.8",
    "pyright>=1.1.0",
    "openapi-python-client>=0.28.0",
    "opentelemetry-sdk>=1.20,<2.0",
]