fix(python): add --no-emit-project to uv export to exclude root project from requirements#13348
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
📝 WalkthroughWalkthroughThis PR adds the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/serverless/lib/plugins/python/lib/uv.js`:
- Around line 73-81: getUvVersion() currently only checks uv
existence/parseability but not minimum version; update getUvVersion() to enforce
uv >= 0.4.7 and throw a clear, actionable error if the detected version is older
(mention required flag --no-emit-project introduced in 0.4.7). Locate the
function getUvVersion() and add semantic version comparison (>= "0.4.7") after
parsing, or normalize and compare major/minor/patch, and ensure the error
message references the flag and required uv version; alternatively, add
equivalent validation where the args array containing '--no-emit-project' is
constructed so callers fail fast with a clear message.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de3eba6b4e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@cursor review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03f2e69bff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
--no-emit-projectflag touv exportcommand so the root project itself is not emitted as a-e .requirement in the generatedrequirements.txtuv_local_packagetest into two focused test cases: root project exclusion and path dependency force-reinstalluv_path_dependencytest fixture with a realistic editable local package structureuv_installertest to validate Docker-based packaging with proper assertions instead ofnoThrow: trueRoot cause
Without
--no-emit-project,uv exportincludes the root project as an editable dependency (-e .) in the requirements output. This causesuv pip installto fail inside Docker containers wherepyproject.toml/setup.pyare not present in the build context, producing confusing metadata errors.Test plan
uv_local_packagetest validates root project is excluded from the packaged artifactuv_path_dependencytest validates local path dependencies are included and force-reinstalled on source changesuv_installertest validates Docker-based packaging succeeds without-estripping warnings or metadata errorsflask/__init__.py,boto3/__init__.py,my_path_package/__init__.py)Related
Fixes #13346
Summary by CodeRabbit
New Features
Tests
Note
Medium Risk
Touches dependency export behavior for
uvprojects and adds new Docker/path-dependency test coverage; risk is mainly around potentially changing which dependencies end up in packaged artifacts.Overview
Fixes
uv-based Python packaging by adding--no-emit-projectto theuv exportcommand so the generatedrequirements.txtno longer includes the root project as an editable-e .entry (avoiding Docker build-context metadata failures).Tests are updated to cover this behavior and local editable path dependencies: the prior
uv_installertest is replaced with a Dockerized packaging assertion,uv_local_packagenow verifies the root project isn’t injected into the artifact, and a newuv_path_dependencyfixture/test validates force-reinstall + packaging of an editable local path dependency.Written by Cursor Bugbot for commit de3eba6. This will update automatically on new commits. Configure here.