Skip to content

Migrate from poetry to uv#191

Open
d33bs wants to merge 4 commits intocytomining:mainfrom
d33bs:move-to-uv
Open

Migrate from poetry to uv#191
d33bs wants to merge 4 commits intocytomining:mainfrom
d33bs:move-to-uv

Conversation

@d33bs
Copy link
Member

@d33bs d33bs commented Feb 13, 2026

Description

This PR migrates from poetry to uv for environment management in the project.

What kind of change(s) are included?

  • Documentation (changes docs or other related content)
  • Bug fix (fixes an issue).
  • Enhancement (adds functionality).
  • Breaking change (these changes would cause existing functionality to not work as expected).

Checklist

Please ensure that all boxes are checked before indicating that this pull request is ready for review.

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have searched for existing content to ensure this is not a duplicate.
  • I have performed a self-review of these additions (including spelling, grammar, and related).
  • These changes pass all pre-commit checks.
  • I have added comments to my code to help provide understanding
  • I have added a test which covers the code changes found within this PR
  • I have deleted all non-relevant text in this pull request template.

Summary by CodeRabbit

  • Chores

    • Migrated project tooling from Poetry to UV across builds, packaging, tests, and CI workflows.
    • Updated dependency management and packaging configuration to align with the new toolchain.
    • Adjusted ignore rules for build/version artifacts.
  • Documentation

    • Updated README, contributing guide, examples, and docs to use UV-based commands and workflow references.

@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

Migrates project tooling from Poetry to UV: updates CI workflows, Dependabot config, pre-commit hooks, pyproject.toml packaging metadata, documentation and example commands, and minor file header and .gitignore entries to reference uv-based commands and build/version handling.

Changes

Cohort / File(s) Summary
GitHub Actions Workflows
.github/workflows/dependabot.yml, .github/workflows/publish-docs.yml, .github/workflows/publish-pypi.yml, .github/workflows/run-tests.yml
Replaced Poetry steps with astral-sh/setup-uv@v7; switched test, build, docs, and publish commands to uv run / uv build; removed Poetry-specific version-reset steps and adjusted workflow comments.
Dependabot Config
.github/dependabot.yml
Changed package-ecosystem from pip/Poetry references to uv and updated update schedule from weekly to monthly (including lockfile interval).
Pre-commit & Hooks
.pre-commit-config.yaml
Removed Poetry hook, updated pyproject-fmt revision, removed --keep pyproject-fmt from pre-commit-update args, and replaced a poetry-run coverage invocation with uv run --frozen style invocation.
Packaging & Tooling Config
pyproject.toml
Switched from Poetry metadata to PEP 621 / setuptools configuration; replaced poetry_dynamic_versioning with setuptools_scm and setuptools.build_meta; added [project] dependencies and [dependency-groups]; updated ruff, pytest, coverage, and uv tool configs.
Documentation & Guides
README.md, docs/src/contributing.md, docs/presentations/2025-sbi2/readme.md
Replaced Poetry badges and example commands with uv equivalents; extensive contributing doc updates to reflect uv-based local workflows, testing, versioning, and docs build instructions.
Ignore & Version Placeholder
.gitignore
Added comment about version placeholder and added _version.py to ignore list.
Source & Test Headers
src/cytodataframe/__init__.py, tests/data/cytotable/.../*.py
Updated header/instruction comments to use uv run instead of poetry run; no functional/code logic changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as "Developer"
  participant GH as "GitHub Actions"
  participant SetupUV as "astral-sh/setup-uv@v7"
  participant UV as "uv (tool)"
  participant Artifact as "Docs / PyPI / Test Runner"

  Dev->>GH: Push or open PR
  GH->>SetupUV: install latest uv runtime/action
  SetupUV-->>GH: uv available
  GH->>UV: run commands (uv run --frozen pytest | uv run --frozen --with docs | uv build)
  UV->>Artifact: build/test/publish artifacts
  Artifact-->>GH: report status / deploy results
  GH-->>Dev: CI status / publish confirmation
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • jenna-tomkinson

Poem

🐰 A little hop from poetry's shore,
UV arrives and opens the door,
Workflows shuffle, commands now run,
Builds and docs hop into the sun,
Hooray — a carrot-shaped CI score! 🥕

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Migrate from poetry to uv' accurately summarizes the main change across the entire changeset, which consistently replaces Poetry-based tooling with uv throughout configuration files, workflows, and documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
pyproject.toml (1)

14-39: Collapse dead Python<3.9 dependency splits.
Line 14 requires Python >=3.11, so the python_full_version<'3.9' branches on lines 32, 36, and 38 are unreachable. Simplify to single entries:

♻️ Proposed cleanup
-  "pandas<2.2.2; python_full_version<'3.9'",
-  "pandas>=2.2.2,<3; python_full_version>='3.9'",
+  "pandas>=2.2.2,<3",
...
-  "pywavelets>=1.4.1,<2; python_full_version<'3.9'",
-  "pywavelets>1.4.1; python_full_version>='3.9'",
+  "pywavelets>1.4.1",
...
-  "scikit-image>=0.19.3,<0.20; python_full_version<'3.9'",
-  "scikit-image>0.19.3; python_full_version>='3.9'",
+  "scikit-image>0.19.3",

Comment @coderabbitai help to get the list of available commands and usage tips.

@d33bs d33bs marked this pull request as ready for review February 13, 2026 21:50
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs/src/contributing.md (2)

90-112: ⚠️ Potential issue | 🟡 Minor

Update versioning documentation to reflect current tooling.

The documentation references poetry-dynamic-versioning but the project configuration (pyproject.toml) explicitly requires setuptools-scm>=8 and uv-dynamic-versioning. Update lines 92, 95, and 111 to reflect the actual versioning tools used to avoid misleading contributors.

Suggested changes
-We use [`poetry-dynamic-versioning`](https://github.com/mtkennerly/poetry-dynamic-versioning) to help version this software through [`PEP 440`](https://peps.python.org/pep-0440/) standards.
+We use `setuptools-scm` with `uv-dynamic-versioning` to produce `PEP 440` versions.
@@
-`poetry-dynamic-versioning` uses `git` tags to help distinguish version data.
+Versioning uses `git` tags to help distinguish version data.
@@
-CytoDataFrame version specifications are controlled through [`poetry-dynamic-versioning`](https://github.com/mtkennerly/poetry-dynamic-versioning) which leverages [`dunamai`](https://github.com/mtkennerly/dunamai)
+CytoDataFrame version specifications are controlled through `setuptools-scm` and `uv-dynamic-versioning`

18-28: ⚠️ Potential issue | 🟡 Minor

uv sync --all-groups command is correct.

Confirmed per current uv documentation: this is the recommended approach for local development/contributors who want all tooling (lint, test, docs, etc.) installed without listing each group individually.

However, the versioning section (lines 90-96) still references poetry-dynamic-versioning and should be updated to align with the migration to uv. Review whether versioning tooling has been migrated or if this reference is now stale.

🤖 Fix all issues with AI agents
In @.github/dependabot.yml:
- Around line 15-16: Update the misleading comment text that says "every week"
to match the configured interval "monthly" for the Dependabot schedule entries;
locate the comment lines adjacent to the interval: "monthly" (the two
occurrences where the comment currently reads "Check for updates to GitHub
Actions every week") and change the wording to reflect "monthly" so the comment
matches interval: "monthly".

In @.github/workflows/dependabot.yml:
- Around line 31-34: Update the workflow to pin the astral-sh/setup-uv and
j178/prek-action actions to immutable commit SHAs and provide an explicit uv
version via the setup-uv `version` input: replace uses: astral-sh/setup-uv@v7
with uses: astral-sh/setup-uv@<commit-sha> and add a with: version: "0.10.0" (or
project-configured version), and replace uses: j178/prek-action@v1 with uses:
j178/prek-action@<commit-sha> so both actions are tied to full commit SHAs to
prevent CI drift and supply-chain risk.

In @.pre-commit-config.yaml:
- Line 18: The pre-commit hook for pyproject-fmt is pinned to a non-existent
release "v2.16.0"; update the rev value in .pre-commit-config.yaml (the
pyproject-fmt hook's rev) to a real PyPI release such as "v2.12.1" (or the
latest available), then run pre-commit autoupdate / pre-commit install to verify
hooks install correctly; retain the existing hook args and uv.lock usage as-is.

In `@pyproject.toml`:
- Around line 1-3: The pyproject build configuration is incompatible because
uv-dynamic-versioning is a Hatchling-only plugin but build-backend is set to
setuptools.build_meta; either remove "uv-dynamic-versioning" from the requires
list and keep build-backend = "setuptools.build_meta" (relying on
"setuptools-scm" only), or change build-backend to "hatchling.build" and keep
"uv-dynamic-versioning" in requires; update the [build-system] section
accordingly referencing build-backend, requires, and the uv-dynamic-versioning
and setuptools-scm symbols.

In `@tests/data/cytotable/NF1_cellpainting_data_shrunken/create_image_data.py`:
- Around line 5-7: The docstring command references the wrong filename: update
the usage example so it matches the actual script name (create_image_data.py) or
rename the file to create.py to match the docstring; specifically, edit the
top-level comment in create_image_data.py to either change the example command
to `uv run python
tests/data/cytotable/NF1_cellpainting_data_shrunken/create_image_data.py` or
rename the file and update any imports/CI references so they point to
`create.py`.
🧹 Nitpick comments (2)
pyproject.toml (2)

22-43: Remove redundant <3.9 dependency markers.

With requires-python >=3.11, the python_full_version<'3.9' branches are unreachable. Consolidating these reduces confusion and lock churn.

Suggested cleanup
-  "pandas<2.2.2; python_full_version<'3.9'",
-  "pandas>=2.2.2,<3; python_full_version>='3.9'",
+  "pandas>=2.2.2,<3",
@@
-  "pywavelets>=1.4.1,<2; python_full_version<'3.9'",
-  "pywavelets>1.4.1; python_full_version>='3.9'",
+  "pywavelets>1.4.1",
@@
-  "scikit-image>=0.19.3,<0.20; python_full_version<'3.9'",
-  "scikit-image>0.19.3; python_full_version>='3.9'",
+  "scikit-image>0.19.3",

5-21: Align Ruff target-version with the project's Python floor.

requires-python is >=3.11, but tool.ruff.target-version is set to py38 (line 87). Since target-version takes precedence over requires-python, Ruff will only enforce compatibility checks for Python 3.8+, not 3.11+. Update it to py311 to match the actual minimum supported version.

Suggested update
 [tool.ruff]
-target-version = "py38"
+target-version = "py311"

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.

1 participant