Update repository to use modern Python packaging and development tooling - #36
Conversation
Assisted-by: oh-my-pi:gpt-5.6-terra
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The CI workflow’s multi-line python -c snippet is indented inside a quoted string and is likely to fail with IndentationError, which would break the new CI import-check step.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
What changed in this PR
This PR modernizes the repository’s Python packaging and development tooling, migrating from setuptools/versioneer to Hatchling + hatch-vcs, introducing pre-commit with Ruff, and updating CI to use uv for locked installs.
Changes:
- Switch build backend to Hatchling with hatch-vcs, bumping minimum Python to 3.11.
- Add pre-commit + Ruff configuration and integrate pre-commit checks into CI.
- Apply a set of small cleanup fixes (mostly removing unused imports and clarifying exports via
__all__).
| File | Description |
|---|---|
| versioneer.py | Removes Versioneer machinery in favor of VCS-based versioning via Hatch. |
| MANIFEST.in | Removes legacy setuptools sdist include rules (now handled by Hatch build). |
| pyproject.toml | Migrates build system to Hatchling/hatch-vcs, adds dev dependency group, and configures Ruff. |
| .pre-commit-config.yaml | Adds Ruff check/format hooks for pre-commit. |
| README.md | Documents uv + pre-commit developer workflow. |
| .gitignore | Adds .venv/ and updates comment for generated version metadata. |
| .github/workflows/ci.yml | Adds a pre-commit job and switches install/import checks to uv. |
| .github/workflows/python-publish.yml | Updates build-and-inspect action version for packaging workflow. |
| src/hxntools/scans.py | Removes unused import. |
| src/hxntools/handlers/rasmi2.py | Removes unused imports. |
| src/hxntools/handlers/bulkdata.py | Removes unused imports. |
| src/hxntools/handlers/__init__.py | Adds __all__ to formalize exports. |
| src/hxntools/detectors/zebra.py | Removes unused local variable assignment. |
| src/hxntools/detectors/utils.py | Removes unused import. |
| src/hxntools/detectors/merlin.py | Removes unused import. |
| src/hxntools/detectors/hxn_xspress3.py | Removes unused imports and narrows nslsii imports to used symbols. |
| src/hxntools/detectors/dexela.py | Removes unused imports and simplifies utils import. |
| src/hxntools/detectors/__init__.py | Adds __all__ to formalize exports. |
| src/hxntools/CompositeBroker.py | Cleans up imports and minor internal adjustments consistent with Ruff fixes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Dan Henriksen (dihenriksen)
left a comment
There was a problem hiding this comment.
Looks good except is there a reason for using uv instead of pixi?
|
Dan Henriksen (@dihenriksen) I prefer uv for packages/libraries since it has cleaner pyproject.toml support. I prefer pixi for applications. |

ruff(formatting is deferred by ignoringsrc/)pre-commituv.locksetuptoolsforhatchlingruff check --fix