-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
143 lines (129 loc) · 4.94 KB
/
Copy pathpyproject.toml
File metadata and controls
143 lines (129 loc) · 4.94 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
[project]
name = "iscc-web"
version = "0.3.2"
description = "ISCC - Generator Web Application"
authors = [{ name = "Titusz", email = "tp@py7.de" }]
requires-python = ">=3.13"
readme = "README.md"
license = "Apache-2.0"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"blacksheep>=2.6,<3",
"uvicorn>=0.34",
"aiofiles>=24.1",
"iscc-sdk[sct,sci]==0.9.3",
"iscc-core>=1.2.1",
"iscc-lib>=0.4.0",
"xxhash>=3.5",
"httpx>=0.28",
"pathvalidate>=3.2",
"aiofile>=3.9",
"jinja2-simple-tags>=0.6",
"pydantic>=2.10",
"pydantic-settings>=2.7",
"gunicorn>=23",
"uvicorn-worker>=0.3",
"sentry-sdk>=2.20",
"watchfiles>=0.21",
]
[project.optional-dependencies]
# onnxruntime now lives in the cpu|gpu extras of iscc-sct/iscc-sci (variant wheels that clobber
# each other in site-packages). Pick exactly one per built image; never both. iscc-sdk[sct,sci]
# forwards the bare libs; these extras attach the onnxruntime variant and the >=0.2.0/>=0.3.0 floor.
cpu = ["iscc-sct[cpu]>=0.2.0", "iscc-sci[cpu]>=0.3.0"]
gpu = ["iscc-sct[gpu]>=0.2.0", "iscc-sci[gpu]>=0.3.0"]
[project.urls]
Homepage = "https://github.com/iscc/iscc-web"
[project.scripts]
iscc-web = "iscc_web.main:main"
[dependency-groups]
dev = [
"pytest>=8.4",
"poethepoet>=0.30",
"pytest-cov>=6.0",
"pytest-xdist>=3.6",
"schemathesis>=4.21",
"datamodel-code-generator>=0.61",
"iscc-samples>=0.6",
"ruff>=0.15.1",
"prek>=0.2.9",
"radon>=6.0.1",
"zensical>=0.0.21",
# CPU onnxruntime for local dev/tests so `uv sync` runs semantic inference without the gpu extra.
"onnxruntime",
]
[tool.uv]
default-groups = "all"
# onnxruntime 1.27.0 dropped CUDA 12 from its default PyPI wheels (moved to CUDA 13); the GPU image
# base is nvidia/cuda:12.6.3-cudnn, so onnxruntime-gpu 1.27.0 fails to import there. Pin the whole
# onnxruntime family to the last CUDA-12 release until the GPU base migrates to CUDA 13.
constraint-dependencies = ["onnxruntime==1.26.0", "onnxruntime-gpu==1.26.0"]
conflicts = [
# The two image variants: cpu and gpu pull mutually-clobbering onnxruntime variant wheels.
[{ extra = "cpu" }, { extra = "gpu" }],
# dev brings CPU onnxruntime; never co-resolve it with the gpu extra's onnxruntime-gpu.
[{ group = "dev" }, { extra = "gpu" }],
]
[tool.uv.build-backend]
module-name = "iscc_web"
module-root = ""
[build-system]
requires = ["uv_build>=0.11.7,<0.12.0"]
build-backend = "uv_build"
[tool.ruff]
target-version = "py313"
line-length = 120
fix = true
[tool.ruff.format]
preview = true
line-ending = "lf"
[tool.ruff.lint.per-file-ignores]
# Star imports register BlackSheep controllers as an import side effect.
"iscc_web/__init__.py" = ["F403"]
[tool.coverage.run]
branch = true
source = ["iscc_web"]
# Tests run against a uvicorn server in a child process (tests/conftest.py); measure it too.
parallel = true
concurrency = ["thread", "multiprocessing"]
sigterm = true
# Some process pool workers exit without executing iscc_web code and legitimately collect no data.
disable_warnings = ["no-data-collected"]
[tool.coverage.report]
skip_empty = true
fail_under = 100
exclude_lines = [
"pragma: no cover",
"if __name__ == .__main__.:",
]
omit = [
# Generated from openapi.yaml by datamodel-code-generator (uv run poe codegen) - never hand-edited.
"iscc_web/api/schema.py",
]
[tool.datamodel-codegen]
input = "iscc_web/static/docs/openapi.yaml"
output = "iscc_web/api/schema.py"
output-model-type = "pydantic_v2.BaseModel"
encoding = "UTF-8"
disable-timestamp = true
target-python-version = "3.13"
formatters = []
[tool.poe.tasks]
formatopenapi = { cmd = "uv run python -m develop.format_openapi", help = "Reformat openapi.yaml" }
codegen = { shell = "uv run datamodel-codegen && uv run ruff format iscc_web/api/schema.py", help = "Build code from OpenAPI Schema" }
format = { cmd = "uv run ruff format .", help = "Format code files" }
precommit = { cmd = "uv run prek run", help = "Run prek hooks on changed files" }
test = { cmd = "uv run python -m pytest -n auto --tb=line --no-header -q --cov --cov-config=pyproject.toml --cov-report=term-missing", help = "Test the code with pytest" }
check-complexity = { cmd = "uv run radon cc --min C --show-complexity --average iscc_web/", help = "Check code complexity with radon" }
run = { cmd = "uv run uvicorn iscc_web.asgi:application --reload", help = "Run dev server" }
docs-serve = { cmd = "uv run zensical serve", help = "Serve docs locally with live reload" }
docs-changelog = { cmd = "uv run python -m develop.copy_changelog", help = "Sync CHANGELOG.md into the docs site" }
docs-build = { sequence = [
{ cmd = "uv run python -m develop.copy_changelog" },
{ cmd = "uv run zensical build" },
{ cmd = "uv run python -m develop.gen_llms_full" },
], help = "Build docs site with llms-full.txt" }
all = { sequence = ["formatopenapi", "codegen", "format", "test", "check-complexity"], help = "Run all tasks" }