-
-
Notifications
You must be signed in to change notification settings - Fork 609
feat: move from poetry to uv #4082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Reviewer's GuideReplaces Poetry with uv as the primary packaging and environment tool, switching build backend to Hatchling, updating Nox sessions and CI workflows to use uv for dependency management, lockfile, builds, and publishing, and adjusting contributor docs accordingly. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - I've found 1 issue, and left some high level feedback:
- The repeated
session.run_install("uv", "sync", ...)blocks across many nox sessions could be extracted into a small helper (e.g._sync_project(session, no_group_integrations: bool = True)) to avoid duplication and keep the sync flags/env consistent in one place. - In
pre-release-pr.yml, the version bump logic usinggrep/sedonpyproject.tomlassumes a singleversion =line and simple formatting; consider switching to a small Python/TOML snippet to read/update the version more robustly if the file structure changes.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The repeated `session.run_install("uv", "sync", ...)` blocks across many nox sessions could be extracted into a small helper (e.g. `_sync_project(session, no_group_integrations: bool = True)`) to avoid duplication and keep the sync flags/env consistent in one place.
- In `pre-release-pr.yml`, the version bump logic using `grep`/`sed` on `pyproject.toml` assumes a single `version =` line and simple formatting; consider switching to a small Python/TOML snippet to read/update the version more robustly if the file structure changes.
## Individual Comments
### Comment 1
<location> `pyproject.toml:142-143` </location>
<code_context>
+[tool.hatch.build.targets.wheel]
+packages = ["strawberry"]
+
+[tool.hatch.build.targets.sdist]
+include = ["/strawberry"]
[tool.pytest.ini_options]
</code_context>
<issue_to_address>
**issue (bug_risk):** The sdist `include` pattern is likely too restrictive and the leading `/` may prevent matching, which can produce a broken source distribution.
With hatch, `include` paths are relative to the project root, so `"/strawberry"` likely matches nothing. Also, limiting the sdist to only the `strawberry` directory will typically omit required files like `pyproject.toml`, README, and license, leading to an incomplete sdist on PyPI.
Either remove the `[tool.hatch.build.targets.sdist]` override to rely on hatch’s defaults, or switch to a relative pattern and explicitly include required files, for example:
```toml
[tool.hatch.build.targets.sdist]
include = [
"strawberry",
"pyproject.toml",
"README*",
"LICENSE*",
]
```
and drop the leading `/` so hatch can resolve the paths correctly.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Hi, thanks for contributing to Strawberry 🍓! We noticed that this PR is missing a So as soon as this PR is merged, a release will be made 🚀. Here's an example of Release type: patch
Description of the changes, ideally with some examples, if adding a new feature.Release type can be one of patch, minor or major. We use semver, so make sure to pick the appropriate type. If in doubt feel free to ask :) Here's the tweet text: |
Greptile SummaryThis PR migrates the project's dependency management and build system from Poetry to uv with hatchling as the build backend. The migration is comprehensive and well-executed across all workflows and documentation. Key Changes:
Issue Found:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant UV as uv Tool
participant Nox as Nox Sessions
participant CI as GitHub Actions
participant PyPI as PyPI Registry
Dev->>UV: uv sync
UV->>UV: Read pyproject.toml + uv.lock
UV->>UV: Install dev + integrations groups
Dev->>Nox: uv run nox -t tests
Nox->>UV: session.run_install("uv", "sync")
UV->>Nox: Install dependencies to virtualenv
Nox->>Nox: Run pytest with test matrix
CI->>CI: Trigger on push/PR
CI->>UV: Install uv via setup-uv@v5
CI->>UV: uv sync (with cache)
UV->>CI: Dependencies installed
CI->>Nox: uv run nox (test matrix)
Nox->>CI: Test results
CI->>UV: uv build (on release)
UV->>UV: Build wheel + sdist via hatchling
CI->>PyPI: uv publish
PyPI->>PyPI: Package published
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9 files reviewed, 1 comment
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4082 +/- ##
==========================================
+ Coverage 94.22% 94.39% +0.16%
==========================================
Files 540 540
Lines 35499 35544 +45
Branches 1876 1881 +5
==========================================
+ Hits 33449 33550 +101
+ Misses 1739 1703 -36
+ Partials 311 291 -20 🚀 New features to boost your workflow:
|
142c3c7 to
036c926
Compare
Apollo Federation Subgraph Compatibility Results
Learn more: |
9c80e2c to
d5220c8
Compare
|
For this we need to also migrate to autopub beta :) patrick91/rich-toolkit@fff431e Like I did here, maybe we can pair on it? 😊 |
uv run automatically syncs the environment with the lockfile, reverting any manually installed packages like graphql-core==3.3.0a9 which is required for incremental execution in the E2E tests. Using --no-sync prevents this automatic sync behavior.
Same issue as e2e-tests: uv run reverts pydantic to v2 from lockfile after manually installing pydantic==1.10 for compatibility.
FastAPI 0.128.0 (in uv.lock) requires Pydantic v2, so we can no longer downgrade to pydantic==1.10. The original comment about starlette compatibility is outdated.
4e6cd13 to
dd8330c
Compare
Summary by Sourcery
Migrate the project’s packaging, dependency management, and automation from Poetry to uv and Hatch, updating local development, CI, and release workflows accordingly.
Build:
CI:
Documentation:
Tests:
Chores: