Skip to content

Switch to uv as packaging tool#28

Open
ghanse wants to merge 2 commits intomainfrom
gregory-hansen/uv-packaging
Open

Switch to uv as packaging tool#28
ghanse wants to merge 2 commits intomainfrom
gregory-hansen/uv-packaging

Conversation

@ghanse
Copy link
Copy Markdown
Collaborator

@ghanse ghanse commented Apr 30, 2026

Summary

  • Replaces hatch-managed dev/test environments with uv-managed dependency resolution
  • Migrates Makefile targets, pre-commit config, and CI workflows (test, test-release, release) to use uv sync / uv run
  • Adds uv.lock, removes per-source [tool.hatch.envs] from pyproject.toml (hatchling stays as the build backend)
  • Updates CONTRIBUTING.md to remove stale hatch-envs guidance and document the make dev setup step

Closes #27

@ghanse ghanse force-pushed the gregory-hansen/uv-packaging branch from c3309b1 to edb0708 Compare April 30, 2026 15:30
@ghanse ghanse requested review from alexott and dmoore247 April 30, 2026 16:47
@alexott alexott requested a review from Copilot May 5, 2026 10:42
Copy link
Copy Markdown
Collaborator

@alexott alexott left a comment

Choose a reason for hiding this comment

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

lgtm, in general. A few comments

Comment on lines -21 to -25
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
python-version: '3.12'
version: "0.11.2"

- name: Build wheels
run: |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we keep cache settings? Or it's not supported in the setup-uv github action?

Comment thread .github/workflows/release.yml Outdated
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405

- name: Setup uv
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe add a comment at the end of the line specifying what task version corresponds to that hash?

Comment thread coverage.xml Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need this file? or just committed by accident?

Comment thread pyproject.toml
readme = "README.md"
license-files = { paths = ["LICENSE.md", "NOTICE.md"] }
requires-python = ">=3.12"
requires-python = ">=3.12,<3.14"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe it's better <3.15?

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the repository’s developer/build workflow from Hatch-managed environments to uv-managed locking, syncing, and execution while keeping hatchling as the build backend. It updates contributor docs, CI, and packaging metadata to align the repo with the new tooling approach.

Changes:

  • Reworks packaging metadata and dependency management around uv, including dependency groups, Python version bounds, and build constraints.
  • Replaces Hatch-based Makefile/CI commands with uv sync, uv run, and uv build.
  • Refreshes contributor-facing docs/examples and adds uv-specific project metadata/files.

Review note: uv.lock is referenced by the PR description, but its full diff was not included in the supplied review context; it was only spot-checked via repository reads.

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/e2e/conftest.py Updates PR/e2e library reference handling.
src/python_data_sources/mqtt/mqtt_streaming.py Adjusts MQTT option parsing and minor formatting.
README.md Refreshes install/dev instructions and example formatting.
pyproject.toml Migrates dependency/env configuration to uv-style groups.
Makefile Replaces Hatch commands with uv-based dev, lint, test, build, and lock targets.
examples/zipdcm/zip-dicom-demo.ipynb Updates documented ZipDCM dependency requirements.
coverage.xml Adds a generated coverage report artifact.
CONTRIBUTING.md Rewrites contributor workflow around make dev / uv.
.python-version Pins the local default Python version to 3.12.
.pre-commit-config.yaml Broadens hook scope and tweaks formatter settings.
.github/workflows/test.yml Migrates CI test/format/e2e jobs to uv-based commands.
.github/workflows/test-release.yml Migrates test-release publishing flow to uv-based build/install steps.
.github/workflows/release.yml Migrates release build workflow to uv-based build steps.
.github/scripts/export_databricks_notebooks.py Mostly formatting/quote normalization cleanup.
.github/scripts/convert_notebooks.py Mostly formatting/quote normalization cleanup.
.build-constraints.txt Adds hash-pinned build constraints for build-system requirements.
uv.lock Adds uv lockfile for resolved dependencies (full diff not provided in review context).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/e2e/conftest.py Outdated
if os.getenv("REF_NAME"):
test_library_ref = f"{test_library_ref}.git@refs/pull/{os.getenv('REF_NAME')}"
return test_library_ref
return f"{test_library_ref}.git@{os.getenv('REF_NAME')}"
self.qos = int(options.get("qos", 2))
self.keep_alive = int(options.get("keepalive", 60))
self.clean_session = options.get("clean_session", False)
self.clean_session = options.get("clean_session", "false").strip().lower() == "true"
Comment thread Makefile

dev:
uv sync --all-extras

Comment thread Makefile

coverage:
$(UV_RUN) pytest --cov src --cov-report=html --timeout 30 tests/unit
open htmlcov/index.html
Comment thread coverage.xml Outdated
<!-- Generated by coverage.py: https://coverage.readthedocs.io/en/7.13.5 -->
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
<sources>
<source>/Users/gregory.hansen/Documents/GitHub/databricks-industry-solutions/python-data-sources/src</source>
self.qos = int(options.get("qos", 2))
self.keep_alive = int(options.get("keepalive", 60))
self.clean_session = options.get("clean_session", False)
self.clean_session = options.get("clean_session", "false").strip().lower() == "true"
Comment thread .pre-commit-config.yaml
Comment on lines 19 to +21
- id: black
name: black
entry: black --line-length 100
entry: black --line-length 120
Comment thread .github/workflows/test-release.yml Outdated
Comment on lines +53 to +56
uv pip install --index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ \
python-data-sources==${{ steps.version.outputs.version }}
python -c "import python_data_sources; print('Import successful!')" No newline at end of file
uv run python -c "import python_data_sources; print('Import successful!')"
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.

Switch to UV as packaging tool

3 participants