-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
136 lines (121 loc) · 3.57 KB
/
pyproject.toml
File metadata and controls
136 lines (121 loc) · 3.57 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
[project]
name = "mouse-tracking"
version = "0.2.6"
description = "Runtime environment for mouse tracking experiments"
requires-python = ">=3.10,<3.11"
packages = ["src/mouse_tracking"]
dependencies = [
"numpy>=1.26.0,<2.2.0",
"scipy==1.11.4",
"pandas==2.0.3",
"opencv-python-headless==4.8.0.76",
"imageio[ffmpeg]==2.31.6",
"pillow==9.4.0",
"matplotlib==3.7.1",
"typer>=0.12.4",
"absl-py==1.4.0",
"pydantic==2.7.4",
"networkx==3.3",
"h5py>=3.11.0",
"pydantic-settings>=2.10.1",
"yacs>=0.1.8",
"plotnine>=0.12.0",
]
[project.optional-dependencies]
# Unified GPU stack (CUDA 12.6 line)
gpu = [
"tensorflow[and-cuda]==2.20.0",
"torch==2.6.0",
"torchvision==0.21.0",
"torchaudio==2.6.0",
"nvidia-cusparselt-cu12==0.6.3",
]
# CPU-only convenience for local tests (unchanged idea)
cpu = [
"tensorflow==2.20.0",
"torch==2.6.0",
"torchvision==0.21.0",
"torchaudio==2.6.0",
]
# ---- uv configuration: point Torch family at cu126 index ----
# ---- uv indexes ----
[[tool.uv.index]]
name = "pypi"
url = "https://pypi.org/simple"
explicit = false
[[tool.uv.index]]
name = "pytorch-cu126"
url = "https://download.pytorch.org/whl/cu126"
explicit = true
# ---- uv per-package sources with markers ----
# Use CUDA wheels only when installing the `gpu` extra AND on platforms that can use them.
# Fall back to CPU wheels when installing the `cpu` extra.
[tool.uv.sources]
torch = [
{ index = "pytorch-cu126", marker = "sys_platform == 'linux' and extra == 'gpu'" },
{ index = "pypi", marker = "sys_platform == 'linux' and extra != 'gpu'" },
]
torchvision = [
{ index = "pytorch-cu126", marker = "sys_platform == 'linux' and extra == 'gpu'" },
{ index = "pypi", marker = "sys_platform == 'linux' and extra != 'gpu'" },
]
torchaudio = [
{ index = "pytorch-cu126", marker = "sys_platform == 'linux' and extra == 'gpu'" },
{ index = "pypi", marker = "sys_platform == 'linux' and extra != 'gpu'" },
]
[project.scripts]
mouse-tracking-runtime = "mouse_tracking.cli.main:app"
mouse-tracking = "mouse_tracking.cli.main:app"
mtr = "mouse_tracking.cli.main:app"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.ruff.lint]
# Enable a selection of rules focused on code quality without being too restrictive
select = [
"E", # pycodestyle errors
"F", # pyflakes
"D", # pydocstyle
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"RUF", # Ruff-specific rules
]
# Ignore specific rules that might be too strict
ignore = [
"D203", # one-blank-line-before-class (conflicts with D211)
"D212", # multi-line-summary-first-line (conflicts with D213)
"D107", # missing docstring in __init__
"D105", # missing docstring in magic method
"D100", # missing module docstring (optional for smaller scripts)
"E501", # line too long (handled by formatter)
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Unused imports in __init__ files
"src/mouse_tracking/cli/*" = ["B008"] # Ignore Typer style function-call-in-default-argument
"src/mouse_tracking/pytorch_inference/hrnet/*" = ["D"] # Third-party code
[tool.pytest.ini_options]
addopts = "--benchmark-skip"
[dependency-groups]
dev = [
{include-group = "lint"},
{include-group = "test"}
]
test = [
"pytest>=8.3.5",
"pytest-benchmark>=5.1.0",
"pytest-cov>=6.1.1",
]
lint = [
"ruff>=0.11.2",
]
docs = [
"mike>=2.1.3",
"mkdocs-autorefs>=1.4.3",
"mkdocs-jupyter>=0.25.1",
"mkdocs-material>=9.6.22",
]