[project] name = "stroke-deepisles-demo" version = "0.1.0" description = "Demo: HF datasets + DeepISLES stroke segmentation + React SPA + FastAPI backend" readme = "README.md" license = { text = "Apache-2.0" } requires-python = ">=3.11" authors = [ { name = "stroke-deepisles-demo contributors" } ] classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering :: Medical Science Apps.", ] keywords = ["stroke", "neuroimaging", "segmentation", "BIDS", "NIfTI", "deep-learning"] dependencies = [ # Core - BIDS + NIfTI lazy loading (maintained fork) "neuroimaging-go-brrrr @ git+https://github.com/The-Obstacle-Is-The-Way/neuroimaging-go-brrrr.git@v0.2.1", "huggingface-hub>=0.25.0", # NIfTI handling "nibabel>=5.2.0", "numpy>=1.26.0,<2.0.0", # Configuration "pydantic>=2.5.0", "pydantic-settings>=2.1.0", # Networking "requests>=2.0.0", ] [project.optional-dependencies] # API server (FastAPI backend for HF Spaces Docker deployment) api = [ "fastapi>=0.115.0", "uvicorn[standard]>=0.32.0", ] # Legacy Gradio UI (being replaced by React frontend) gradio = [ "gradio>=6.0.0,<7.0.0", "matplotlib>=3.8.0", "gradio_niivueviewer", ] [project.scripts] stroke-demo = "stroke_deepisles_demo.cli:main" [dependency-groups] dev = [ "pytest>=8.0.0", "pytest-cov>=4.1.0", "pytest-mock>=3.12.0", "pytest-timeout>=2.3.0", "mypy>=1.19.0", "ruff>=0.14.0", "pre-commit>=3.6.0", # Type stubs "types-requests", ] [build-system] requires = ["hatchling"] build-backend = "hatchling.build" [tool.hatch.metadata] allow-direct-references = true [tool.hatch.build.targets.wheel] packages = ["src/stroke_deepisles_demo"] [tool.uv.sources] gradio_niivueviewer = { path = "packages/niivueviewer", editable = true } # ───────────────────────────────────────────────────────────────── # Tool configurations # ───────────────────────────────────────────────────────────────── [tool.ruff] target-version = "py312" line-length = 100 src = ["src", "tests"] # Exclude auto-generated files from Gradio custom component exclude = ["packages/niivueviewer/demo/space.py"] [tool.ruff.lint] select = [ "E", # pycodestyle errors "W", # pycodestyle warnings "F", # pyflakes "I", # isort "B", # flake8-bugbear "C4", # flake8-comprehensions "UP", # pyupgrade "ARG", # flake8-unused-arguments "SIM", # flake8-simplify "TCH", # flake8-type-checking "PTH", # flake8-use-pathlib "RUF", # ruff-specific ] ignore = [ "E501", # line too long (handled by formatter) ] [tool.ruff.lint.isort] known-first-party = ["stroke_deepisles_demo"] [tool.mypy] python_version = "3.12" strict = true warn_return_any = true warn_unused_ignores = true disallow_untyped_defs = true plugins = ["pydantic.mypy"] # Exclude auto-generated Gradio custom component demo files exclude = "packages/niivueviewer/" [[tool.mypy.overrides]] module = [ "nibabel.*", "gradio.*", "gradio_niivueviewer.*", "datasets.*", "niivue.*", "numpy.*", "pyarrow.*", "pytest.*", # FastAPI route decorators cause "untyped decorator" errors in strict mode # See: https://github.com/tiangolo/fastapi/discussions/7463 "fastapi.*", "starlette.*", "uvicorn.*", # DeepISLES modules (only available in DeepISLES Docker image) "src.isles22_ensemble", ] ignore_missing_imports = true [tool.pytest.ini_options] testpaths = ["tests"] python_files = ["test_*.py"] python_functions = ["test_*"] addopts = [ "-v", "--tb=short", "--strict-markers", "-m", "not integration", # Skip integration tests by default ] markers = [ "integration: marks tests requiring external resources (Docker, network)", "slow: marks tests that take >10s to run", ] filterwarnings = [ "ignore::DeprecationWarning", ] [tool.coverage.run] source = ["src/stroke_deepisles_demo"] branch = true [tool.coverage.report] exclude_lines = [ "pragma: no cover", "if TYPE_CHECKING:", "raise NotImplementedError", ]