-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpyproject.toml
More file actions
209 lines (186 loc) · 5.7 KB
/
pyproject.toml
File metadata and controls
209 lines (186 loc) · 5.7 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
[project]
name = "tesseract-core"
description = "A toolkit for universal, autodiff-native software components."
readme = "README.md"
authors = [
{name = "The Tesseract team @ Pasteur Labs + OSS contributors", email = "info@simulation.science"},
]
license = { text = "Apache-2.0" }
requires-python = ">=3.10,<3.15"
dependencies = [
"jinja2",
"rich",
"typer",
"pyyaml",
"pydantic",
"numpy",
"requests>=2.32.4",
"pip",
"packaging",
"pybase64",
"orjson",
]
dynamic = [
# Injected via hatch-vcs
"version",
]
[project.scripts]
tesseract = "tesseract_core.sdk.cli:entrypoint"
tesseract-core = "tesseract_core.sdk.cli:entrypoint"
tesseract-runtime = "tesseract_core.runtime.cli:main"
[project.optional-dependencies]
# RUNTIME DEPENDENCIES
# These are the only dependencies that are installed into Tesseract containers, so may contain duplicates of deps above.
# They should be kept minimal and stable at all times.
#
# NOTE: Upper bounds (<=) on runtime deps are periodically updated via .github/workflows/bump_lockfile.yml,
# do not edit manually. To add constraints, use other operators (e.g. <, >=, ~=, ==) as needed.
runtime = [
"pydantic<=2.13.3,>=2.10",
"fastapi<=0.136.1,>=0.115",
"requests<=2.33.1,>=2.32.4",
"uvicorn<=0.46.0,>=0.34",
"click<=8.3.3,>=8.1",
"typer<=0.25.0,>=0.15",
"fsspec[http,s3]<=2026.3.0,>=2024.12",
"pybase64<=1.4.3,>=1.4",
"orjson<=3.11.8,>=3.10",
"numpy<=2.4.4,>=1.26",
"debugpy<=1.8.20,>=1.8.14",
"mlflow-skinny<=3.11.1,>=3.7.0",
]
# END RUNTIME DEPENDENCIES
docs = [
"sphinx<9", # TODO: Remove when https://github.com/click-contrib/sphinx-click/pull/160 is merged
"sphinx_autodoc_typehints",
"furo",
"myst-nb",
"sphinx_click",
"autodoc_pydantic",
"sphinx_design",
"sphinx_copybutton",
"sphinxext_opengraph",
"tesseract-core[runtime]",
]
dev = [
"docker",
"fastapi",
"httpx", # required by fastapi test client
"numpy",
"pre-commit",
"pytest",
"pytest-cov",
"pytest-mock",
"pytest-benchmark",
"pytest-timeout",
"moto[server]",
"aiobotocore>=2.19.0", # without this pip dependency resolution fails
"typeguard",
# also add all other extras here
"tesseract-core[runtime]",
"tesseract-core[docs]",
]
[project.urls]
Homepage = "https://github.com/pasteurlabs/tesseract-core"
Documentation = "https://docs.pasteurlabs.ai/projects/tesseract-core/latest"
[build-system]
requires = ["hatchling", "hatch-vcs", "setuptools-scm!=9.0.0"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "tesseract_core/_version.py"
[tool.hatch.build.targets.wheel]
packages = ["tesseract_core"]
[tool.hatch.build.targets.sdist]
include = [
"tesseract_core/",
"examples/",
"requirements.txt",
"README.md",
"LICENSE",
]
[tool.pytest.ini_options]
addopts = ["--typeguard-packages=tesseract_core", "--durations=10"]
testpaths = ["tests"]
filterwarnings = [
"error",
# ignored by default
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
"ignore::ImportWarning",
# raised by Cython, usually harmless
"ignore:numpy.dtype size changed",
"ignore:numpy.ufunc size changed",
# sometimes, dependencies leak resources
"ignore:.*socket\\.socket.*:pytest.PytestUnraisableExceptionWarning",
"ignore:.*sqlite3\\.Connection.*:pytest.PytestUnraisableExceptionWarning",
]
[tool.coverage.run]
branch = true
source = ["tesseract_core"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"pass",
]
ignore_errors = true
omit = [
"tesseract_core/_version.py",
]
[tool.ruff]
# Set to the lowest supported Python version.
target-version = "py310"
# Set the target line length for formatting.
line-length = 88
# Exclude a variety of commonly ignored directories.
extend-exclude = [
".venv",
"_version.py",
]
# Also lint/format Jupyter Notebooks.
extend-include = ["*.ipynb"]
src = ["."]
[tool.ruff.lint]
# Select and/or ignore rules for linting.
# Full list of available rules: https://docs.astral.sh/ruff/rules/
extend-select = [
"ANN", # Type annotations
"B", # Flake8 bugbear
"D", # Pydocstyle
"E", # Pycodestyle errors
"F", # Pyflakes
"I", # Isort
"NPY", # Numpy
"RUF", # Ruff-specific rules
"UP", # Pyupgrade
"W", # Pycodestyle warnings
]
ignore = [
"E731", # Do not assign a lambda expression, use a def
"D100", # Pydocstyle: missing docstring in public module
"D104", # Pydocstyle: missing docstring in public package
"D105", # Pydocstyle: missing docstring in magic method
"D107", # Pydocstyle: missing docstring in __init__
"D203", # Pydocstyle: one blank line before class' docstring. Conflicts with D211
"D213", # Pydocstyle: multiline docstring summary start on 2nd line. Conflicts with D212
"ANN202", # Type annotations: allow missing return type for private functions
"ANN401", # Type annotations: allow Any
]
[tool.ruff.lint.extend-per-file-ignores]
# Ignore missing docstrings and type annotations for selected directories
"docs/*" = ["D101", "D102", "D103", "D106", "ANN"]
"tests/*" = ["D101", "D102", "D103", "D106", "ANN"]
"benchmarks/*" = ["D101", "D102", "D103", "D106", "ANN"]
"examples/**/*" = ["D101", "D102", "D103", "D106", "ANN"]
"tesseract_core/sdk/templates/*" = ["D101", "D102", "D103", "D106", "ANN"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pycodestyle]
max-line-length = 120 # Allow some flexibility in line lengths: up to 120 cols
max-doc-length = 120
[tool.ruff.format]
# Enable reformatting of code snippets in docstrings.
docstring-code-format = true