Skip to content

Import fix for pytest 9.1.0+ - #22

Merged
joaonc merged 6 commits into
mainfrom
wip-1
Jul 5, 2026
Merged

Import fix for pytest 9.1.0+#22
joaonc merged 6 commits into
mainfrom
wip-1

Conversation

@joaonc

@joaonc joaonc commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Pytest 9.1.0 change 14137 (full changelog here) made pytest.ScopeName public, which broke an import in this package.

Fixed so it's compatible both with 9.1.0+ and 9.1.0- versions.

Summary by CodeRabbit

  • Bug Fixes

    • Improved compatibility with newer pytest releases by updating how test parameter scope is handled.
    • Kept type information aligned across supported pytest versions to reduce typing-related issues.
  • Chores

    • Removed an unused dependency-management command set from the tool configuration.

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@joaonc, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f7db2397-6e05-4aee-bd81-699ffaa17489

📥 Commits

Reviewing files that changed from the base of the PR and between ba656ca and 99ddd3d.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .github/workflows/linting.yml
  • .github/workflows/tests.yml
  • admin/utils.py
  • pyproject.toml
  • src/pytest_params/params.py
📝 Walkthrough

Walkthrough

Removed the admin.pip Typer CLI module and its registration in pyproject.toml. Updated ScopeName typing in pytest_params: params.py adds pytest >= 9.1.0 import support and updates the scope parameter annotation; params.pyi renames the _ScopeName type alias to ScopeName and updates the corresponding annotation.

Changes

Admin CLI Removal

Layer / File(s) Summary
Remove pip CLI module and registration
admin/pip.py, pyproject.toml
Deletes the Typer-based pip CLI module (Requirements enum, compile/sync/package/upgrade/install commands) and removes its 'admin.pip' entry from the tool.typer-invoke modules list.

ScopeName Typing Update

Layer / File(s) Summary
Version-conditional ScopeName import and usage
src/pytest_params/params.py
Adds a pytest >= 9.1.0 import path for ScopeName, retains fallback imports for earlier versions, and updates the params() scope parameter annotation to ScopeName | None.
Stub type alias rename
src/pytest_params/params.pyi
Renames the _ScopeName type alias to ScopeName and updates the params() scope keyword annotation to reference ScopeName.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 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 accurately captures the pytest 9.1.0+ import compatibility fix, which is a main part of the changeset.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wip-1

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@src/pytest_params/params.py`:
- Around line 11-16: Update the version-gated import in params.py so the pytest
>= 9.1.0 branch uses the public pytest.ScopeName type instead of importing
ScopeName from the private _pytest.scope module. Keep the existing fallback
behavior for older pytest versions, and adjust the conditional import logic
around the ScopeName alias accordingly.
🪄 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: fa54ec80-99c8-4b40-83b9-4cbf30d418de

📥 Commits

Reviewing files that changed from the base of the PR and between 2e35b5d and ba656ca.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • admin/pip.py
  • pyproject.toml
  • src/pytest_params/params.py
  • src/pytest_params/params.pyi
💤 Files with no reviewable changes (2)
  • pyproject.toml
  • admin/pip.py

Comment thread src/pytest_params/params.py
@joaonc
joaonc merged commit 8b0abe6 into main Jul 5, 2026
4 checks passed
@joaonc
joaonc deleted the wip-1 branch July 5, 2026 22:49
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