[chore] Migrate from poetry to uv#4267
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
Railway Preview Environment
Updated at 2026-05-05T17:59:29.163Z |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (6)
sdk/check_deps.py (1)
97-110: ⚡ Quick winAdd error handling for PyPI requests.
urllib.request.urlopencan raiseURLError,HTTPError, or timeout exceptions. A single network failure will crash the entire script, losing any progress on previous packages.Proposed fix with error handling
def load_pypi_latest(package_names: list[str]) -> dict[str, str]: latest: dict[str, str] = {} for name in package_names: - with urllib.request.urlopen( - f"https://pypi.org/pypi/{name}/json", timeout=10 - ) as response: - payload = json.loads(response.read().decode("utf-8")) - version = payload.get("info", {}).get("version") - if not version: + try: + with urllib.request.urlopen( + f"https://pypi.org/pypi/{name}/json", timeout=10 + ) as response: + payload = json.loads(response.read().decode("utf-8")) + version = payload.get("info", {}).get("version") + if not version: + continue + latest[name] = version + except (urllib.error.URLError, urllib.error.HTTPError, TimeoutError) as e: + print(f"Warning: Failed to fetch {name} from PyPI: {e}") continue - latest[name] = version return latestNote: You'll also need to add
import urllib.errorat the top.api/oss/docker/Dockerfile.gh (1)
6-6: 💤 Low valueUnused
ARGdeclaration.
ARG UV_VERSIONis declared in the builder stage but never used. Theuvbinary is copied from theuvstage viaCOPY --from=uv, so this ARG serves no purpose here.🧹 Proposed fix
FROM python:3.11-slim-bookworm AS builder -ARG UV_VERSION - WORKDIR /app.github/workflows/12-check-unit-tests.yml (1)
99-104: 💤 Low valueMinor inconsistency:
--no-syncflag usage differs between jobs.The SDK test run command (line 104) uses
uv run pythonwithout--no-sync, while the API (line 161) and services (line 230) jobs useuv run --no-sync python. Sinceuv syncruns immediately before,--no-syncis appropriate and slightly faster. Consider adding it here for consistency.- run: uv run python run-tests.py -- oss/tests/pytest/unit + run: uv run --no-sync python run-tests.py -- oss/tests/pytest/unitdocs/docs/contributing/guides/testing.mdx (2)
55-63: ⚡ Quick winDocumentation inconsistency: API test commands don't use
uv run.The SDK section correctly uses
uv run pytest, but the API section uses barepython -m pytest. For consistency with uv workflow and to ensure the correct virtual environment is used, these should also useuv run:Then run the acceptance suite or a smaller target: ```bash -python -m pytest oss/tests/pytest/ -v +uv run pytest oss/tests/pytest/ -v-python -m pytest oss/tests/pytest/acceptance/workflows/ -v +uv run pytest oss/tests/pytest/acceptance/workflows/ -v--- `83-90`: _⚡ Quick win_ **Services section is incomplete: no test execution commands.** The Services Tests section shows dependency installation but omits the pytest command. Consider adding the test execution step for completeness: ```diff ```bash uv sync uv pip install --editable ../sdk
+Then run the relevant pytest targets:
+
+bash +uv run pytest oss/tests/pytest/unit/ -v +</blockquote></details> <details> <summary>services/check_deps.py (1)</summary><blockquote> `97-110`: _💤 Low value_ **Consider adding basic error handling for PyPI requests.** `load_pypi_latest()` will crash the script if any PyPI request fails (network issues, 404 for a private/renamed package, etc.). A try/except would make this dev tool more robust: <details> <summary>🛡️ Proposed improvement</summary> ```diff def load_pypi_latest(package_names: list[str]) -> dict[str, str]: latest: dict[str, str] = {} for name in package_names: - with urllib.request.urlopen( - f"https://pypi.org/pypi/{name}/json", timeout=10 - ) as response: - payload = json.loads(response.read().decode("utf-8")) - version = payload.get("info", {}).get("version") - if not version: + try: + with urllib.request.urlopen( + f"https://pypi.org/pypi/{name}/json", timeout=10 + ) as response: + payload = json.loads(response.read().decode("utf-8")) + version = payload.get("info", {}).get("version") + if not version: + continue + latest[name] = version + except Exception: continue - latest[name] = version return latest
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 18f41d37-7ff4-4093-bffd-b7522373598a
⛔ Files ignored due to path filters (6)
api/poetry.lockis excluded by!**/*.lockapi/uv.lockis excluded by!**/*.locksdk/poetry.lockis excluded by!**/*.locksdk/uv.lockis excluded by!**/*.lockservices/poetry.lockis excluded by!**/*.lockservices/uv.lockis excluded by!**/*.lock
📒 Files selected for processing (23)
.github/workflows/01-create-release-branch.yml.github/workflows/11-check-code-styling.yml.github/workflows/12-check-unit-tests.yml.github/workflows/44-railway-tests.ymlapi/check_deps.pyapi/ee/docker/Dockerfile.devapi/ee/docker/Dockerfile.ghapi/oss/docker/Dockerfile.devapi/oss/docker/Dockerfile.ghapi/pyproject.tomldocs/designs/testing/README.mddocs/docs/contributing/guides/testing.mdxsdk/__init__.pysdk/check_deps.pysdk/oss/tests/pytest/unit/README.mdsdk/oss/tests/pytest/unit/TESTING_PATTERNS.mdsdk/pyproject.tomlservices/check_deps.pyservices/ee/docker/Dockerfile.devservices/ee/docker/Dockerfile.ghservices/oss/docker/Dockerfile.devservices/oss/docker/Dockerfile.ghservices/pyproject.toml
[chore] Move to uvloop and httptools
[chore] Bump to python 3.13 / debian 13
[chore] Include typical FastAPI speedups
No description provided.