Skip to content

ci: add pytest job for minimum dependency versions#2080

Draft
mik-laj wants to merge 3 commits into
frenck:mainfrom
mik-laj:agents/ticket-review-2071-2069
Draft

ci: add pytest job for minimum dependency versions#2080
mik-laj wants to merge 3 commits into
frenck:mainfrom
mik-laj:agents/ticket-review-2071-2069

Conversation

@mik-laj
Copy link
Copy Markdown
Collaborator

@mik-laj mik-laj commented May 23, 2026

Summary

Adds a new CI job pytest-min-deps that verifies the library works with the lowest allowed versions of its direct dependencies, as declared in pyproject.toml.

Motivation

The existing CI always installs the latest compatible dependency versions via poetry install. This means the declared minimum version bounds (e.g. aiohttp>=3.0.0, yarl>=1.6.0) were never actually tested — the library could be incompatible with its own declared minimums without anyone noticing.

Related to #2072.

How it works

Uses uv pip install --resolution=lowest-direct, which automatically resolves to the lowest allowed version of each direct dependency. The job runs on Python 3.11 (the oldest supported version) and is independent from the coverage pipeline.


Generated by GitHub Copilot in VS Agent

Summary by CodeRabbit

  • Chores
    • CI adds a new test job that installs the project with minimum direct dependency versions and runs the test suite without coverage.
    • Existing test and coverage workflows remain unchanged; coverage still depends on the original test run.

Review Change Stack

Add a new CI job 'pytest-min-deps' that installs the lowest allowed
versions of direct dependencies (as declared in pyproject.toml) using
uv's --resolution=lowest-direct flag, then runs the test suite.

This ensures the declared minimum version bounds are actually compatible
with the library.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 23, 2026 14:35
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 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: 9a9cb45a-b449-4738-aaea-9e09f23a0fa1

📥 Commits

Reviewing files that changed from the base of the PR and between 3dbd828 and efcb413.

📒 Files selected for processing (1)
  • .github/workflows/tests.yaml

📝 Walkthrough

Walkthrough

Adds a new pytest-min-deps GitHub Actions job that installs uv, uses uv pip install --resolution=lowest-direct -e ".[cli]", installs a minimal set of test packages, and runs pytest tests --no-cov on env.DEFAULT_PYTHON.

Changes

Minimal Dependency Testing

Layer / File(s) Summary
Minimal dependency test job
.github/workflows/tests.yaml
New pytest-min-deps job sets up Python, installs uv and the project with --resolution=lowest-direct, installs minimal test-only packages (aioresponses, pytest, pytest-asyncio, pytest-cov, syrupy), and runs pytest tests --no-cov.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped into CI's bright light,
Installed with uv in the night,
Lowest deps I chased and found,
Tests ran quiet, no coverage sound,
A small green check — such delight! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a new CI job to test minimum dependency versions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a dedicated CI job to run the test suite against the lowest allowed versions of direct dependencies, helping ensure the package remains compatible with its declared dependency floors.

Changes:

  • Add new pytest-min-deps job to .github/workflows/tests.yaml.
  • Install dependencies via uv pip install --resolution=lowest-direct and run pytest on the oldest supported Python (3.11).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/tests.yaml Outdated
Comment on lines +65 to +69
- name: 🏗 Install dependencies (minimum versions)
run: >
uv pip install --system --resolution=lowest-direct
-e ".[cli]"
aioresponses pytest pytest-asyncio pytest-cov covdefaults syrupy
Comment thread .github/workflows/tests.yaml Outdated
Comment on lines +70 to +71
- name: 🚀 Run pytest
run: pytest tests
- Split dependency install into two steps: project with
  --resolution=lowest-direct, test tools installed separately
  to avoid applying lowest-direct to pytest/aioresponses/etc.
- Add --no-cov to pytest invocation to override pyproject.toml
  addopts = "--cov" since this job doesn't collect coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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

🧹 Nitpick comments (1)
.github/workflows/tests.yaml (1)

59-62: 💤 Low value

Consider adding cache for uv to improve CI performance.

The main pytest job uses cache: "poetry" (line 35), but this job has no caching configured. You could add cache: "pip" here to cache uv's dependencies, which would speed up subsequent runs.

⚡ Proposed optimization
       - name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
         uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
         with:
           python-version: ${{ env.DEFAULT_PYTHON }}
+          cache: "pip"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/tests.yaml around lines 59 - 62, Add caching for the
Python dependencies used by the job that sets up Python (the step using
actions/setup-python with env.DEFAULT_PYTHON) by adding cache: "pip" to that job
definition; specifically, update the job that contains the "🛠 Set up Python ${{
env.DEFAULT_PYTHON }}" step to include a top-level cache: "pip" entry (similar
to the other pytest job's cache: "poetry") so uv's dependencies are cached
between CI runs and speed up subsequent jobs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/tests.yaml:
- Around line 67-68: The CI step named "🏗 Install test dependencies" currently
installs pytest and plugins but omits pytest-cov, causing pytest to fail due to
the project-wide addopts = "--cov" in pyproject.toml; update the run command in
that step to include pytest-cov alongside pytest, pytest-asyncio, aioresponses,
and syrupy so the coverage option is available to pytest during the workflow.

---

Nitpick comments:
In @.github/workflows/tests.yaml:
- Around line 59-62: Add caching for the Python dependencies used by the job
that sets up Python (the step using actions/setup-python with
env.DEFAULT_PYTHON) by adding cache: "pip" to that job definition; specifically,
update the job that contains the "🛠 Set up Python ${{ env.DEFAULT_PYTHON }}"
step to include a top-level cache: "pip" entry (similar to the other pytest
job's cache: "poetry") so uv's dependencies are cached between CI runs and speed
up subsequent jobs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6d945aa0-a871-424f-86f5-8553f44f79c4

📥 Commits

Reviewing files that changed from the base of the PR and between d2a5f86 and 3dbd828.

📒 Files selected for processing (1)
  • .github/workflows/tests.yaml

Comment thread .github/workflows/tests.yaml Outdated
pytest-cov must be installed even when --no-cov is passed, because
pyproject.toml addopts = "--cov" causes pytest to load the plugin
on startup before --no-cov can take effect.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 23, 2026 15:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment on lines +65 to +68
- name: 🏗 Install package (minimum dependency versions)
run: uv pip install --system --resolution=lowest-direct -e ".[cli]"
- name: 🏗 Install test dependencies
run: uv pip install --system aioresponses pytest pytest-asyncio pytest-cov syrupy
Comment on lines +67 to +68
- name: 🏗 Install test dependencies
run: uv pip install --system aioresponses pytest pytest-asyncio pytest-cov syrupy
@mik-laj mik-laj marked this pull request as draft May 23, 2026 17:15
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.

2 participants