Skip to content

Update repository to use modern Python packaging and development tooling - #36

Merged
Thomas Hopkins (thopkins32) merged 3 commits into
mainfrom
pre-commit
Sep 21, 2026
Merged

Thomas Hopkins (thopkins32) merged 3 commits into
mainfrom
pre-commit

Conversation

@thopkins32

Copy link
Copy Markdown
Contributor
  • Adds ruff (formatting is deferred by ignoring src/)
  • Adds pre-commit
  • Adds uv.lock
  • Changes setuptools for hatchling
  • Bumps min Python version to 3.11
  • Various fixes exposed by ruff check --fix

Copilot AI lite review requested due to automatic review settings September 21, 2026 15:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 High severity

Open (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.

Comment thread .github/workflows/ci.yml

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.

Looks good except is there a reason for using uv instead of pixi?

@thopkins32

Copy link
Copy Markdown
Contributor Author

Dan Henriksen (@dihenriksen) I prefer uv for packages/libraries since it has cleaner pyproject.toml support. I prefer pixi for applications.

@thopkins32
Thomas Hopkins (thopkins32) merged commit 5070c23 into main Sep 21, 2026
10 checks passed
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.

3 participants