Skip to content

chore(deps): fix dependency resolution for unsupported Python versions#32

Merged
calebevans merged 2 commits into
mainfrom
chore/deps
Apr 4, 2026
Merged

chore(deps): fix dependency resolution for unsupported Python versions#32
calebevans merged 2 commits into
mainfrom
chore/deps

Conversation

@calebevans
Copy link
Copy Markdown
Owner

@calebevans calebevans commented Apr 4, 2026

Description

Fix UV dependency resolution failures caused by unsupported Python version splits and remove unnecessary lock file artifacts.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • 🧪 Test improvement

Changes Made

  • Cap requires-python to <3.14 to avoid resolution failures for packages without Python 3.14 support
  • Remove uv.lock since it is unnecessary for a library project
  • Remove invalid exclude-newer = "7 days" from [tool.uv] (expects an absolute RFC 3339 date, not a relative string)

Testing

  • I have run pytest and all tests pass
  • I have added tests that cover my changes (if applicable)
  • I have tested manually with real log files

Checklist

  • I have run pre-commit run --all-files and fixed any issues
  • I have updated the documentation (if applicable)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes

The requires-python = ">=3.10" constraint was unbounded, causing UV to resolve dependencies for all Python versions including 3.14+. Since packages like litellm don't publish 3.14-compatible builds yet, this caused unsatisfiable dependency errors. Capping at <3.14 resolves this until ecosystem support catches up.

Summary by CodeRabbit

  • Chores
    • Narrowed Python compatibility to >=3.10,<3.15 and bumped the litellm dependency.
    • Updated container base image and adjusted production install behavior.
    • Restored uv.lock to .gitignore and removed the tool-specific configuration block.
  • Tests
    • CI matrix expanded to include Python 3.14.

- Cap requires-python to <3.14 to avoid resolution failures for packages without 3.14 support
- Remove uv.lock since it is unnecessary for a library project
- Remove invalid exclude-newer = "7 days" from [tool.uv]

Made-with: Cursor
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3e7e417f-410a-479c-b733-ed9409284d31

📥 Commits

Reviewing files that changed from the base of the PR and between 1ab3d34 and e03f1cd.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • Containerfile
  • pyproject.toml
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/ci.yml
🚧 Files skipped from review as they are similar to previous changes (2)
  • pyproject.toml
  • Containerfile

📝 Walkthrough

Walkthrough

Uncommented uv.lock in .gitignore; narrowed Python support to >=3.10,<3.15 and bumped litellm to >=1.83.0; removed [tool.uv] block from pyproject.toml; added Python 3.14 to CI matrix; updated Containerfile to use python:3.13-slim and switch to non-editable installs plus build-step changes.

Changes

Cohort / File(s) Summary
Ignore rule
\.gitignore
Uncommented uv.lock so the file is no longer ignored.
Project metadata
pyproject.toml
Set requires-python to >=3.10,<3.15, updated litellm to >=1.83.0, and removed the [tool.uv] configuration block (including exclude-newer).
CI matrix
.github/workflows/ci.yml
Added Python 3.14 to the GitHub Actions test matrix (3.103.14).
Container build
Containerfile
Bumped base image python:3.11-slimpython:3.13-slim; changed install flow from editable installs and explicit llama-cpp-python CMake step to creating src/cordon/__init__.py, non-editable install with CMake args, copying src/, then uv pip install --system --no-deps .; added Vulkan dev/tools packages.

Sequence Diagram(s)

(omitted — changes do not introduce a new multi-component sequential flow warranting a diagram)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I nudged the lock out from the log,
A quiet change beneath the fog.
Python ranges snug and tight,
New base image, build takes flight.
Hooray — installs hop into the night! 🥕

🚥 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 'chore(deps): fix dependency resolution for unsupported Python versions' directly and accurately summarizes the main objective of the pull request, which is to fix UV dependency resolution failures by capping Python version support and adjusting dependency constraints.
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
  • Commit unit tests in branch chore/deps

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.

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.

🧹 Nitpick comments (1)
Containerfile (1)

17-23: Layer caching optimization pattern is valid but fragile.

The two-stage install pattern is a recognized Docker optimization:

  1. Install dependencies against stub package (layer cached until pyproject.toml changes)
  2. Copy source and reinstall with --no-deps

This works correctly because dependency resolution reads from pyproject.toml, not from Python imports in __init__.py.

However, consider these edge cases:

  • Dynamic version: If using dynamic = ["version"] with a version read from source files, the first install may fail or use wrong metadata
  • Build hooks: Custom build backends that introspect source code would break
  • Non-.py package data: Files like py.typed or data files won't exist during the first install

If the project uses standard static metadata, this should work fine. Consider adding a comment explaining the caching strategy for future maintainers.

📝 Suggested documentation comment
 COPY pyproject.toml README.md LICENSE ./
+# Create stub package structure for dependency caching.
+# Dependencies are resolved from pyproject.toml, not source imports.
 RUN mkdir -p src/cordon && touch src/cordon/__init__.py
 
 RUN CMAKE_ARGS="-DGGML_VULKAN=on" \
     uv pip install --system ".[llama-cpp]"
 
 COPY src/ ./src/
+# Reinstall package with actual source; --no-deps skips dependency re-resolution
 RUN uv pip install --system --no-deps .
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Containerfile` around lines 17 - 23, Add a brief comment above the two-stage
install RUN commands (the layer-caching pattern that first runs `uv pip install
--system ".[llama-cpp]"` before copying `src/` and running `uv pip install
--system --no-deps .`) explaining that this optimizes Docker layer caching by
installing dependencies from static pyproject.toml metadata, and call out known
caveats: it breaks if metadata uses `dynamic = ["version"]` sourced from code,
if custom build hooks inspect source, or if package data (e.g. py.typed or other
non-.py files) is required during the first install; recommend removing the
optimization when any of those conditions apply.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@Containerfile`:
- Around line 17-23: Add a brief comment above the two-stage install RUN
commands (the layer-caching pattern that first runs `uv pip install --system
".[llama-cpp]"` before copying `src/` and running `uv pip install --system
--no-deps .`) explaining that this optimizes Docker layer caching by installing
dependencies from static pyproject.toml metadata, and call out known caveats: it
breaks if metadata uses `dynamic = ["version"]` sourced from code, if custom
build hooks inspect source, or if package data (e.g. py.typed or other non-.py
files) is required during the first install; recommend removing the optimization
when any of those conditions apply.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6cc6d3ce-8a01-4ce1-81eb-3af9ab7f110b

📥 Commits

Reviewing files that changed from the base of the PR and between b9caa2a and 1ab3d34.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • Containerfile
  • pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • pyproject.toml

- Add Python 3.14 to CI test matrix and bump requires-python to <3.15
- Bump litellm to >=1.83.0 for Python 3.14 compatibility
- Upgrade container base image from python:3.11-slim to python:3.13-slim
- Optimize Containerfile layer caching by installing deps before copying source
- Eliminate redundant llama-cpp-python compilation by building with Vulkan in a single step
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 4, 2026

@calebevans calebevans merged commit cb10b1f into main Apr 4, 2026
12 checks passed
@calebevans calebevans deleted the chore/deps branch April 4, 2026 16:29
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