Skip to content

Migrate from poetry to uv#191

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

Migrate from poetry to uv#191
d33bs wants to merge 6 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 from Poetry to UV as the primary package manager.
    • Updated build backend and versioning system to align with current Python packaging standards.
    • Refreshed CI/CD workflows to support the new tooling ecosystem.

@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

The project migrates from Poetry to UV as the primary task runner and dependency manager. The build backend switches from poetry_dynamic_versioning to setuptools with setuptools-scm for versioning. Metadata moves from Poetry-specific [tool.poetry] to PEP 621 standard [project] configuration in pyproject.toml.

Changes

Cohort / File(s) Summary
GitHub Workflows
.github/workflows/dependabot.yml, publish-docs.yml, publish-pypi.yml, run-tests.yml
Replaced Poetry environment setup and commands with UV setup via astral-sh/setup-uv@v7. Updated test execution from poetry run pytest to uv run --frozen pytest. Replaced pre-commit action with prek-based step in dependabot workflow. Removed Poetry version simulation steps.
Build Configuration
pyproject.toml
Major migration from Poetry metadata ([tool.poetry]) to PEP 621 standard ([project]). Build backend changed from poetry_dynamic_versioning to setuptools.build_meta with setuptools-scm. Added [tool.setuptools] and [tool.setuptools_scm] configuration for packaging and version management. Replaced Poetry dependency groups with [dependency-groups]. Updated Ruff target-version to py311.
Pre-commit & Environment
.pre-commit-config.yaml, .gitignore
Removed poetry-check hook from pre-commit config. Updated code-cov-gen to use uv run --frozen instead of poetry run. Updated pyproject-fmt revision. Added _version.py to .gitignore to exclude generated version file.
Documentation
README.md, docs/src/contributing.md, docs/presentations/2025-sbi2/readme.md
Updated Poetry badge to UV badge in README. Replaced Poetry references throughout contributing guide with UV equivalents. Changed example commands from poetry run poe to uv run poe. Updated versioning documentation to reference setuptools-scm instead of poetry-dynamic-versioning.
Source & Test Scripts
src/cytodataframe/__init__.py, tests/data/cytotable/*/...py
Minor documentation comment updates in init.py. Updated instructional headers in test data scripts from Poetry-based execution to UV equivalents. No functional code changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 UV hops in where Poetry once sang,
Setuptools-scm now keeps version's gang,
PEP 621 standards clean and bright,
Configuration files gleaming with light,
Build, test, and docs—all running just right! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 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' directly and clearly summarizes the main change across all files in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

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

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

Comments