Skip to content

build: migrate to uv, add ruff/ty, format all files#95

Closed
FIrgolitsch wants to merge 508 commits into
mainfrom
pr-a-build-tooling
Closed

build: migrate to uv, add ruff/ty, format all files#95
FIrgolitsch wants to merge 508 commits into
mainfrom
pr-a-build-tooling

Conversation

@FIrgolitsch

@FIrgolitsch FIrgolitsch commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Stacked PR 1/13 — review order: #95#97#98#99#100#101#108#106#107#87#109#110#111

Base: main. After merge, the rest of the chain rebases onto main automatically.


PR #95 — Build Tooling & Formatting

Migrates the build system to modern Python tooling and applies consistent formatting across the codebase. Prerequisite for all other stacked PRs (#87, #97#111).

Build system: setup.py → uv + pyproject.toml

  • Full pyproject.toml: project metadata, core deps, optional extras (gpu, gpu-cuda12, gpu-cuda13, docs, dev), entries in [project.scripts]
  • uv.lock for reproducible resolution
  • Remove setup.py, requirements.txt, requirements-pytest.txt
  • Dockerfile updated to use uv

Lint & format: ruff + ty

  • [tool.ruff] — target py312, line-length 127, rules E/F/W/I/UP/B/RUF/SIM/C4/PIE/PTH
  • [tool.ruff.lint.isort]_thread_config in its own section (must import before numpy/jax to set thread caps)
  • [tool.ty] — linumpy-only, py312, cupy/cupyx/numba → Any, relaxed overrides for tests and GPU modules
  • .pre-commit-config.yaml — ruff-format, ruff lint (--fix), ty (advisory / non-blocking)
  • ruff format applied to all Python files; ruff check --fix applied (import ordering, f-strings, type upgrades, PTH replacements where safe)

CI & Docker

  • .github/workflows/python-app.ymlastral-sh/setup-uv@v5, uv sync, uv run ruff, uv run ty, uv run pytest
  • Dockerfile switched from pip to uv

Other

  • linumpy/py.typed marker
  • .gitignore additions for uv / ty caches and local benchmark outputs

Notes

  • Some pre-existing lint warnings remain (a few PTH/SIM/E501) — will be mopped up in the dependent PRs as they touch those files
  • [project.scripts] here only contains scripts present at the branch point; each stacked PR adds its own entries

CHrlS98 and others added 30 commits March 27, 2025 15:54
Update installation instruction for readme
Update README.md with the new installation instructions.
Added changes from sbh-microscope repo into linumpy
The new function detects the galvo shift using the normalized mutual information between the galvo return and the image.
Scripts to perform and apply manual correction to 2.5D volume
…and refactor volume loading to support JSON configuration
2.5D/3D reconstruction pipelines bug fixes

@CHrlS98 CHrlS98 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it as mostly formatting but I still went through all the files. It has been a good opportunity to get back into the code. I have a few comments of course. Hopefully there are not too many other 125 files PR 🥲

Comment thread linumpy/io/__init__.py
Comment thread linumpy/io/data_io.py Outdated
Comment thread linumpy/io/npz.py Outdated
Comment thread linumpy/io/npz.py Outdated
Comment thread linumpy/microscope/oct.py
Comment thread scripts/linum_detect_rehoming.py
Comment thread scripts/linum_resample_nifti.py Outdated
Comment thread scripts/linum_stack_slices.py
Comment thread linumpy/imaging/transform.py
Comment thread linumpy/mosaic/quick_stitch.py
@FIrgolitsch

Copy link
Copy Markdown
Contributor Author

Superseded by #115main has been restored to its original commit f0df3bf4 (same content), and a fresh PR was opened on the same branch pr-a-build-tooling since GitHub permanently locked this one after the earlier force-push to main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants