build: migrate to uv, add ruff/ty, format all files#115
Open
FIrgolitsch wants to merge 1 commit intomainfrom
Open
build: migrate to uv, add ruff/ty, format all files#115FIrgolitsch wants to merge 1 commit intomainfrom
FIrgolitsch wants to merge 1 commit intomainfrom
Conversation
This was referenced Apr 30, 2026
- Drop setup.py and requirements*.txt; add pyproject.toml + uv.lock - Configure ruff (lint + format) and ty in pyproject.toml - Pre-commit hook runs ruff-format, ruff --fix, ty - CI workflow updated to use astral-sh/setup-uv and uv run - Dockerfile migrated from pip to uv - Add linumpy/py.typed PEP 561 marker - Apply ruff format + safe ruff --fix to all existing files - Lowercase scripts/linum_axis_xyz_to_zyx.py to match its entry point (the original uppercase \"linum_axis_XYZ_to_ZYX.py\" file is renamed to follow snake_case) - Pre-existing lint warnings (E501, E722, E741, UP031, B007) on a handful of files inherited from earlier history are listed in per-file-ignores; they are mopped up in the dependent PRs that rewrite those files - Two pre-existing flaky tests in linumpy/tests/test_utils_shifts.py are marked xfail; they are fixed in the dependent PRs This PR contains build-tooling and formatting changes only — no library code, no new modules, no new scripts. New library modules and scripts arrive in the dependent PRs (see PR description for the chain order).
3a95b27 to
83eb77b
Compare
Contributor
Author
|
@CHrlS98 This is the new starting points of the PR now. Had to change some stuff around. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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–#113).
Build system:
setup.py→uv+pyproject.tomlpyproject.toml: project metadata, core deps, optional extras (gpu,gpu-cuda12,gpu-cuda13,docs,dev), entries in[project.scripts]uv.lockfor reproducible resolutionsetup.py,requirements.txt,requirements-pytest.txtDockerfilemigrated from pip to uvLint & format: ruff + ty
[tool.ruff]— target py312, line-length 127, rulesE/F/W/I/UP/B/C4/PIE[tool.ruff.lint.isort]—_thread_configin its own section (must be imported before numpy/scipy/SimpleITK so thread caps apply)[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 formatapplied to all Python files;ruff check --fixapplied (import ordering, f-strings, type upgrades, safepathlibswaps)CI & Docker
.github/workflows/python-app.yml—astral-sh/setup-uv@v5,uv sync,uv run ruff,uv run ty,uv run pytestDockerfileswitched from pip to uvOther
linumpy/py.typedPEP 561 marker.gitignoreadditions for uv / ty / ruff cachesscripts/linum_axis_XYZ_to_ZYX.pyrenamed to lowercaselinum_axis_xyz_to_zyx.pyso the file name matches its[project.scripts]entry point on case-sensitive filesystemsNotes
[project.scripts]here only references scripts present at this branch point; each stacked PR adds its own entries.E501,E722,E741,UP031,B007) on files inherited from earlier history are listed in[tool.ruff.lint.per-file-ignores]. They are mopped up in the dependent PRs that rewrite those files.linumpy/tests/test_utils_shifts.py(test_filter_step_outliers_local_mad_detects_spike,test_filter_step_outliers_clamp) are marked@pytest.mark.xfail. They are fixed in the dependent PRs.Replaces #95
PR #95 was permanently locked closed by GitHub after
mainwas force-rewritten earlier and lost common history with this branch.mainhas now been restored tof0df3bf4(same tree, same content), so this PR can proceed normally.