/ tests / python / pyproject.toml
pyproject.toml
 1  # Copyright 2025 Alibaba Group Holding Ltd.
 2  #
 3  # Licensed under the Apache License, Version 2.0 (the "License");
 4  # you may not use this file except in compliance with the License.
 5  # You may obtain a copy of the License at
 6  #
 7  #     http://www.apache.org/licenses/LICENSE-2.0
 8  #
 9  # Unless required by applicable law or agreed to in writing, software
10  # distributed under the License is distributed on an "AS IS" BASIS,
11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  # See the License for the specific language governing permissions and
13  # limitations under the License.
14  
15  [project]
16  name = "opensandbox-e2e-tests"
17  version = "0.1.0"
18  description = "E2E tests for OpenSandbox Python SDK"
19  readme = "README.md"
20  requires-python = ">=3.10"
21  license = { text = "MIT" }
22  authors = [
23      { name = "OpenSandbox Team", email = "ninan.nn@alibaba-inc.com" }
24  ]
25  dependencies = [
26      "pytest>=9.0.3",
27      "pytest-asyncio>=0.21.0",
28      "pytest-timeout>=2.1.0",
29      "pytest-order>=1.2.0",
30      "pydantic>=2.0.0",
31      "opensandbox",
32      "opensandbox-code-interpreter",
33  ]
34  
35  [dependency-groups]
36  dev = [
37      "ruff>=0.14.8",
38      "pyright>=1.1.407",
39  ]
40  
41  [tool.uv]
42  # This is a test runner project (no importable package); don't try to build/install it.
43  package = false
44  
45  [tool.uv.sources]
46  opensandbox = { path = "../../sdks/sandbox/python", editable = true }
47  opensandbox-code-interpreter = { path = "../../sdks/code-interpreter/python", editable = true }
48  
49  [build-system]
50  requires = ["hatchling"]
51  build-backend = "hatchling.build"
52  
53  [tool.pytest.ini_options]
54  testpaths = ["tests"]
55  python_files = ["test_*.py"]
56  python_classes = ["Test*"]
57  python_functions = ["test_*"]
58  addopts = [
59      "-v",
60      "-s",
61      "--tb=short",
62      "--strict-markers",
63      "--asyncio-mode=auto",
64      "--order-scope=class",
65  ]
66  markers = [
67      "e2e: marks tests as end-to-end tests",
68      "slow: marks tests as slow running",
69      "order: run tests in specific order",
70  ]
71  asyncio_mode = "auto"
72  asyncio_default_fixture_loop_scope = "session"
73  asyncio_default_test_loop_scope = "session"
74  timeout = 300
75  log_cli = true
76  log_cli_level = "INFO"
77  log_cli_format = "%(asctime)s [%(levelname)s] %(name)s - %(message)s"
78  log_cli_date_format = "%Y-%m-%d %H:%M:%S"
79  
80  [tool.ruff.lint]
81  select = [
82      "E",  # pycodestyle errors
83      "W",  # pycodestyle warnings
84      "F",  # pyflakes
85      "I",  # isort
86      "B",  # flake8-bugbear
87      "C4", # flake8-comprehensions
88      "UP", # pyupgrade
89  ]
90  ignore = [
91      "E501", # line too long, handled by formatter
92      "B008", # do not perform function calls in argument defaults
93      "C901", # too complex
94      "B017", # pytest.raises(Exception) is too broad
95  ]
96  
97  [tool.ruff.lint.per-file-ignores]
98  "__init__.py" = ["F401"]