Skip to content

feat: uv#336

Open
chyroc wants to merge 2 commits into
mainfrom
uv
Open

feat: uv#336
chyroc wants to merge 2 commits into
mainfrom
uv

Conversation

@chyroc
Copy link
Copy Markdown
Collaborator

@chyroc chyroc commented Jan 13, 2026

Summary by CodeRabbit

  • Chores
    • Migrated build system and packaging to Hatch/PEP 621 conventions.
    • Updated CI/CD workflows and release pipeline to use uv as the dependency manager and task runner.
    • Updated contributor docs with new installation instructions.
    • Added ".devbox/" to .gitignore and streamlined CI publish steps for PyPI.

✏️ Tip: You can customize this high-level summary in your review settings.

- 将 CI/CD 工作流中的 Poetry 命令替换为 uv 命令
- 更新 PyPI 发布工作流以使用 uv 构建和发布
- 删除 poetry.lock 文件并添加 uv.lock
- 更新 CONTRIBUTING.md 文档,说明使用 uv 而非 Poetry
- 在 .gitignore 中添加 .devbox/ 目录

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 13, 2026

📝 Walkthrough

Walkthrough

Migration of project tooling from Poetry to the uv CLI and Hatch/PEP 621 packaging. CI/CD workflows and release pipelines updated to invoke uv; pyproject.toml restructured to PEP 621 with hatchling build backend; docs, tests, and .gitignore adjusted accordingly.

Changes

Cohort / File(s) Change Summary
CI / Release Workflows
.github/workflows/ci.yml, .github/workflows/pypi-release.yml
Replace Poetry steps with uv equivalents; add astral-sh/setup-uv@v5 install step (with caching) after checkout; update test/lint/build commands to uv invocations; break combined publish step into explicit uv + Python setup + PyPI publish using password token.
Project Metadata & Build
pyproject.toml
Replace [tool.poetry] configuration with PEP 621 [project] metadata; move dependencies to [project.dependencies] and dev deps to [project.optional-dependencies]; switch build-system to Hatch (hatchling) and add [tool.hatch.build.*] targets; adjust authors, license, and requires-python fields.
Docs & Misc
CONTRIBUTING.md, .gitignore
Update contribution instructions from Poetry to uv (curl installer and uv sync --all-extras); add .devbox/ to .gitignore; fix minor formatting/code-fence issues.
Tests (format tweak)
tests/test_api_apps.py, tests/test_workspaces.py
Minor whitespace changes in f-strings (id_{i + 1}) with no behavioral effect.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I hopped from Poetry to uv's trail,
Curling scripts and hatchling sail,
CI swapped steps, builds now gleam,
Dependencies synced in a swift stream,
A tiny rabbit cheers the new dev grail ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'feat: uv' is vague and provides minimal context about the changeset. While it references uv (the tool being adopted), it doesn't convey why this migration matters or what the primary change accomplishes. Consider a more descriptive title like 'feat: migrate from Poetry to uv package manager' or 'feat: replace Poetry with uv for dependency management and build'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ddb250 and e8d4abf.

📒 Files selected for processing (2)
  • tests/test_api_apps.py
  • tests/test_workspaces.py
✅ Files skipped from review due to trivial changes (2)
  • tests/test_api_apps.py
  • tests/test_workspaces.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test (Python 3.8 on macOS)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions
Copy link
Copy Markdown

Requires label: feature, enhancement, fix, bugfix, bug, chore, documentation.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.53%. Comparing base (dfdc431) to head (e8d4abf).

@@           Coverage Diff           @@
##             main     #336   +/-   ##
=======================================
  Coverage   91.53%   91.53%           
=======================================
  Files          92       92           
  Lines        8646     8646           
=======================================
  Hits         7914     7914           
  Misses        732      732           
Files with missing lines Coverage Δ
tests/test_api_apps.py 100.00% <100.00%> (ø)
tests/test_workspaces.py 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@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: 1

Caution

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

⚠️ Outside diff range comments (1)
CONTRIBUTING.md (1)

9-9: Typo: "active" should be "activate".

Suggested fix
-active the virtual environment:
+activate the virtual environment:
🤖 Fix all issues with AI agents
In @.github/workflows/ci.yml:
- Line 24: Remove the Python 3.7 entry from the CI job matrix: locate the matrix
item that sets python-version: "3.7" (the line with '- { python-version: "3.7",
os: "ubuntu-22.04", os-label: "Ubuntu" }') and delete or replace it with a
supported version (>= "3.8"), ensuring the workflow matrix only includes Python
versions compatible with uv.
🧹 Nitpick comments (2)
.github/workflows/pypi-release.yml (1)

14-17: Update actions/setup-python to v5.

The actions/setup-python@v4 action is outdated. Version 5 is available and recommended for compatibility with newer GitHub Actions runners.

Suggested fix
       - name: Set up Python
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: "3.11"
.github/workflows/ci.yml (1)

31-34: Update actions/setup-python to v5.

Same as in pypi-release.yml, update to the latest version for better compatibility.

Suggested fix
       - name: Set up Python
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: "${{ matrix.python-version }}"
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dfdc431 and 7ddb250.

⛔ Files ignored due to path filters (2)
  • poetry.lock is excluded by !**/*.lock
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .github/workflows/ci.yml
  • .github/workflows/pypi-release.yml
  • .gitignore
  • CONTRIBUTING.md
  • pyproject.toml
🧰 Additional context used
🪛 actionlint (1.7.10)
.github/workflows/ci.yml

32-32: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

.github/workflows/pypi-release.yml

15-15: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 LanguageTool
CONTRIBUTING.md

[grammar] ~27-~27: Use a hyphen to join words.
Context: ...``shell uv sync --all-extras ## Pre Commit shell pre-commit install ``` ...

(QB_NEW_EN_HYPHEN)

🔇 Additional comments (7)
.gitignore (1)

16-16: LGTM!

Adding .devbox/ to the ignore list is appropriate for the new tooling setup and aligns with the sdist exclude configuration in pyproject.toml.

.github/workflows/pypi-release.yml (1)

12-13: LGTM on the uv migration!

The migration from Poetry to uv for building and the switch to the official pypa/gh-action-pypi-publish action is a solid improvement. The separation of build and publish steps provides better clarity and aligns with PyPA best practices.

Also applies to: 18-23

CONTRIBUTING.md (1)

15-24: LGTM on the uv documentation update!

The instructions correctly reflect the migration to uv with the standard curl-based installer and uv sync --all-extras for dependency installation.

.github/workflows/ci.yml (1)

27-30: LGTM on the uv CI migration!

The workflow correctly migrates all Poetry commands to their uv equivalents. Enabling uv caching is a good optimization for CI performance.

Also applies to: 36-47

pyproject.toml (3)

1-22: LGTM on the PEP 621 migration!

The migration from Poetry-specific format to PEP 621 standard [project] table is well-structured. The Python version markers for httpx and websockets correctly handle compatibility across Python 3.7-3.12+.


24-34: LGTM on dev dependencies configuration.

Moving development dependencies to [project.optional-dependencies] under a dev key follows PEP 621 conventions and works well with uv sync --all-extras.


66-81: LGTM on Hatch build configuration.

The sdist exclusions appropriately filter out development and IDE directories, and the wheel configuration correctly specifies the cozepy package. The migration to hatchling as the build backend is consistent with the uv tooling choice.

Comment thread .github/workflows/ci.yml
@@ -24,24 +24,27 @@ jobs:
- { python-version: "3.7", os: "ubuntu-22.04", os-label: "Ubuntu" }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

uv Python 3.7 support compatibility

💡 Result:

Short answer: uv does NOT support Python 3.7 — it requires Python 3.8 or newer. [1][2]

Sources:

  • uv PyPI / project docs. [1]
  • uv platform/python support (lists supported Python versions: 3.8–3.14). [2]

Remove Python 3.7 from the CI matrix — uv does not support it.

uv requires Python 3.8 or newer. The matrix entry for Python 3.7 on ubuntu-22.04 is incompatible with uv and will cause CI failures.

🤖 Prompt for AI Agents
In @.github/workflows/ci.yml at line 24, Remove the Python 3.7 entry from the CI
job matrix: locate the matrix item that sets python-version: "3.7" (the line
with '- { python-version: "3.7", os: "ubuntu-22.04", os-label: "Ubuntu" }') and
delete or replace it with a supported version (>= "3.8"), ensuring the workflow
matrix only includes Python versions compatible with uv.

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