Skip to content

chore: Modernize tox configuration and workflows - #1494

Merged
Czaki merged 5 commits into
developfrom
napari_fixes
Nov 4, 2026
Merged

Czaki merged 5 commits into
developfrom
napari_fixes

Conversation

@Czaki

@Czaki Czaki commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

As napari dropped pyqt5 the tests start failing we need to modernize test definition

Summary by Sourcery

Modernize test and packaging automation for current Python, Qt, and napari versions while improving tox environment coverage and diagnostics.

New Features:

  • Expand automated napari compatibility testing to cover PyQt6 and PySide6 across supported Python versions and napari 0.9.2.

Bug Fixes:

  • Exclude the PySide6 release with a known reference-counting crash on older Python versions.
  • Update test workflows and dependency constraints to use current Python and Qt backend combinations.

Enhancements:

  • Modernize the tox configuration with tox 4 syntax, consolidated environments, configurable work directories, and updated napari version coverage.

Build:

  • Run PyInstaller packaging with Python 3.14 and its corresponding dependency constraints.

CI:

  • Update Azure and GitHub Actions test matrices, reporting, failure diagnostics, and workflow environment configuration for current Python, Qt, and napari versions.

Summary by CodeRabbit

  • Tests

    • Automated test runs now cover Python 3.10–3.14 with PyQt6 and PySide6 across configured napari versions.
    • Test configurations now include napari 0.9.2 and updated Python and Qt combinations.
    • Azure tests now run with Python 3.13 and PyQt6.
    • Failure reports now include the Qt backend, making test failures easier to identify.
  • Chores

    • The PyInstaller build pipeline now uses Python 3.14.

Czaki added 2 commits November 4, 2026 09:58
As napari dropped pyqt5 the tests start failing we need to modernize test definition
@sourcery-ai

sourcery-ai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Modernizes tox 4 configuration and CI workflows by updating Python and napari targets, replacing PyQt5-oriented test environments with current Qt backends, centralizing environment-specific dependencies and reporting, and propagating backend/work-directory settings through Azure and GitHub Actions.

Flow diagram for centralized tox test execution

flowchart TD
    Start[Select tox environment]
    Config[Apply shared pass_env and dependencies]
    Backend[Install selected Qt backend extra]
    Target[Install selected napari target]
    Tests[Run pytest with JSON reporting]

    Start --> Config
    Config --> Backend
    Backend --> Target
    Target --> Tests
Loading

File-Level Changes

Change Details Files
Modernize tox environment definitions and dependency configuration for current tox syntax and napari/Qt compatibility.
  • Add tox 4 minimum version and configurable work directory via TOX_WORK_DIR.
  • Replace legacy tox keys and consolidate shared dependencies, extras, reporting, and commands.
  • Update supported Python, Qt backend, and napari-version environment combinations, including napari 0.9.2 and revised PySide2 coverage.
  • Move environment-specific package selection into tox extras and constraints.
tox.ini
Align Azure test and packaging jobs with newer Python versions, constraints, and Qt backend.
  • Run Azure tests on Python 3.13 with PyQt6 and update tox and constraint references.
  • Build the PyInstaller artifact on Python 3.14 using matching constraints.
  • Update cache keys and installation commands for the new constraint files.
.azure-pipelines/tests.yaml
.azure-pipelines/pyinstaller.yaml
Expand GitHub Actions coverage and make test execution/reporting compatible with the revised tox setup.
  • Run napari repository tests across PyQt6 and PySide6 and include the backend in job names and failure reports.
  • Add TOX_WORK_DIR overrides for workflow jobs.
  • Update widget testing from napari70 to napari92.
  • Pass backend metadata through prerelease and failure-report workflows.
.github/workflows/base_test_workflow.yml
.github/workflows/test_napari_repo.yml
.github/workflows/test_napari_widgets.yml
.github/workflows/test_prereleases.yml
.github/TEST_FAIL_TEMPLATE.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The PR revises tox test environments and updates Azure Pipelines and GitHub Actions to use new Python, Qt backend, and napari selections. It also configures tox work directories, adds backend details to failure reports, and constrains a PySide6 dependency for Python versions below 3.12.

Changes: CI test matrix and tox updates

Layer / File(s) Summary
Define tox environments and commands
tox.ini, pyproject.toml
tox now lists explicit Python, backend, and napari combinations. It consolidates test selections and updates dependencies, report options, and paths. The PySide6 optional dependency excludes version 6.12.0 when Python is below 3.12.
Configure GitHub test workflows
.github/workflows/base_test_workflow.yml, .github/workflows/test_napari_repo.yml, .github/workflows/test_napari_widgets.yml, .github/workflows/test_prereleases.yml, .github/TEST_FAIL_TEMPLATE.md
The workflows set tox work directories, add PyQt6 and PySide6 to the napari repository matrix, and select napari 0.9.2 for the latest-release job. Failure reports include backend details.
Update Azure Python test pipelines
.azure-pipelines/pyinstaller.yaml, .azure-pipelines/tests.yaml
The PyInstaller pipeline uses Python 3.14 and its constraints file. The test pipeline uses Python 3.13, its constraints file, and the PyQt6 tox environment.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Possibly related issues

  • 4DNucleome/PartSeg#1481: This issue reports a PyInstaller bundle test failure in the pre-release workflow, which this PR also updates; the failure cause is not specified.
  • 4DNucleome/PartSeg#1460: This issue reports a pip install --pre failure in the pre-release workflow, which this PR updates; the failure cause is not specified.
  • 4DNucleome/PartSeg#1484: This PR adds PySide6 to the napari repository workflow matrix, which relates to the issue’s PySide6 workflow failure; the failure cause is not specified.

Possibly related PRs

  • 4DNucleome/PartSeg#1493: Both PRs change tox environment selections and PyInstaller Python 3.14 setup.
  • 4DNucleome/PartSeg#1492: This PR adds PySide6 test environments, which exercise the signal compatibility changes in PR #1492.
Merge Risk: Minimal · up to d6250

The revised test combinations are consistent with their workflow callers. No actionable merge-blocking issue was identified; merge after normal checks pass.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "chore: Modernize tox configuration and workflows" matches the main change. The changeset updates tox.ini (Python/backend/napari matrix, removed testenv blocks, path changes), the GitHub Act…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Title check

Explanation

The title "chore: Modernize tox configuration and workflows" matches the main change. The changeset updates tox.ini (Python/backend/napari matrix, removed testenv blocks, path changes), the GitHub Actions workflows (TOX_WORK_DIR, PyQt6 and PySide6 backend matrix, napari version updates), and the Azure pipelines (Python 3.13 and 3.14 with new constraints files). The title is concise, specific, and follows the conventional commit style. It does not mention the napari 0.9.2 support or the PyQt5 removal, but it does not need to cover every detail.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 0c7c922 and d625072.

Files selected for processing: 1
  • pyproject.toml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="tox.ini" line_range="14" />
<code_context>
+    py{311,312,313,314}-{PyQt6,PySide6}-napari_repo
+    py{310,311,312,313}-{PyQt5,PyQt6}-napari_62
+    py{310,311,312,313,314}-{PyQt5,PyQt6}-napari_70
+    py{311,312,313,314}-{PyQt5,PyQt6}-napari_92
+    py{312,313}-PySide6-napari_62
+    py{312,313,314}-PySide6-napari_{70,92}
</code_context>
<issue_to_address>
**PyQt5 napari tests remain enabled**

When running the default tox environment list, tox creates these environments with `napari==0.9.2`, so the default test matrix still exercises the backend combination napari dropped and those environments fail instead of providing a runnable test suite.

Remove PyQt5 from the napari_92 environment expansion, keeping it only for napari versions that support that backend.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: tox.ini:14


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread tox.ini Resolved
@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.61%. Comparing base (ea55379) to head (d625072).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1494      +/-   ##
===========================================
- Coverage    92.63%   92.61%   -0.02%     
===========================================
  Files          211      211              
  Lines        33247    33247              
===========================================
- Hits         30797    30792       -5     
- Misses        2450     2455       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Czaki Czaki changed the title Modernize tox configuration and workflows chore: Modernize tox configuration and workflows Nov 4, 2026
@Czaki Czaki added this to the 0.17.1 milestone Nov 4, 2026
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@Czaki
Czaki merged commit a42ee65 into develop Nov 4, 2026
68 of 69 checks passed
@Czaki
Czaki deleted the napari_fixes branch November 4, 2026 14:23
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