-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
91 lines (81 loc) · 3.6 KB
/
Copy pathpyproject.toml
File metadata and controls
91 lines (81 loc) · 3.6 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
# ─────────────────────────────────────────────────────────────────────────────
# CuPy is NOT a declared dependency. It is installed on demand by
# scripts/install_cupy.py, which detects the host NVIDIA GPU + CUDA Toolkit and
# picks the matching wheel at runtime. `uv sync` therefore never installs cupy.
#
# Selection logic (mirrors scripts/install_cupy.py):
# No NVIDIA GPU -> install nothing. The base package runs on the NumPy
# fallback (numpy + numba only).
# GPU + CUDA Toolkit -> cupy-cuda{MAJOR}x (uses the system CUDA
# Toolkit, no bundled libs). {MAJOR} from `nvcc --version`.
# GPU, no CUDA Toolkit -> cupy-cuda{MAJOR}x[ctk] (bundles CUDA libs via PyPI).
# {MAJOR} inferred from `nvidia-smi`'s max supported CUDA
# version; defaults to 12 when undetectable.
#
# Supported CUDA majors: 11 -> cupy-cuda11x, 12 -> cupy-cuda12x, 13 -> cupy-cuda13x.
# Only one cupy dist may be installed at a time; the script scrubs all of
# [cupy, cupy-cuda11x, cupy-cuda12x, cupy-cuda13x] before installing the chosen one.
#
# Install with: uv run python scripts/install_cupy.py
# ─────────────────────────────────────────────────────────────────────────────
[project]
name = "image-proc-toolkit"
version = "0.2.0"
description = "Image-processing toolkit (FFT upsampling, interpolation, sub-pixel translation, co-registration)."
readme = "README.md"
requires-python = ">=3.12"
license = { text = "MIT" }
authors = [{ name = "Yap Joon Siong" }]
dependencies = [
"numpy",
"numba",
]
[project.optional-dependencies]
dev = [
"pytest>=8",
"pytest-cov>=5",
"mypy>=1.11",
"ruff>=0.6",
]
[tool.hatch.build.targets.wheel]
packages = ["src/imageProcToolkit"]
[tool.ruff]
line-length = 100
target-version = "py312"
[tool.ruff.lint]
# N (pep8-naming) is deliberately excluded so camelCase functions/variables
# are not flagged -- see CONVENTIONS.md "Naming conventions".
select = ["E", "F", "W", "I", "UP", "B"]
ignore = ["E501"] # line length handled by the formatter
[tool.ruff.format]
# Match .editorconfig / .gitattributes so the formatter and editors agree on
# line endings across platforms.
line-ending = "lf"
[tool.mypy]
# Enforces the "type hints required on public functions" rule from
# CONVENTIONS.md. Scoped to the shipped package; tests are not type-checked.
files = ["src/imageProcToolkit"]
python_version = "3.12"
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
no_implicit_optional = true
show_error_codes = true
# CuPy ships without type stubs; silence missing-import errors for it (the
# array-module dispatch params are typed `Any` -- see CONVENTIONS.md "GPU
# coverage rule"). NumPy is fully stubbed and stays strictly checked.
[[tool.mypy.overrides]]
module = ["cupy", "cupyx.*"]
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["tests"]
# Strict, cheap, always on. Coverage is NOT measured here so the dev loop
# (`uv run pytest`) stays fast and does not fail during red-phase work; the
# coverage threshold is enforced by `scripts/check.py` instead.
addopts = ["--strict-markers", "--strict-config", "-ra"]