Skip to content

Conversation

@willingc
Copy link
Contributor

@willingc willingc commented Jul 14, 2025

Closes #237. This PR adds Python 3.13 support.

Co-authored with @psobolewskiPhD using #240 code changes for CI.

Key Changes

  1. Enum Compatibility Layer (napari_animation/_enum_compat.py):
    - Python 3.13 introduced stricter enum handling requiring enum.member() wrapper for callable values
    - Created compatibility layer that detects Python version and conditionally wraps enum values
    - Updated Easing and Interpolation enums to use this wrapper
  2. CI/CD Updates:
    - Added Python 3.13 to test matrix
    - Updated GitHub Actions from v4 to v5
  3. Development Tool Updates:
    - Black updated to v25.1.0 with py313 target
    - Added skip-string-normalization to preserve quote styles
    - Fixed ruff linting and Black formatting issues
  4. Test Infrastructure:
    - Added comprehensive enum compatibility tests
    - Updated mocking for Python 3.10 compatibility
  5. Drop support for 3.9

The changes ensure napari-animation works seamlessly across Python 3.10-3.13 while maintaining backward compatibility.

@codecov
Copy link

codecov bot commented Jul 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.58%. Comparing base (6592f05) to head (b9ae48e).
Report is 38 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #239      +/-   ##
==========================================
+ Coverage   86.24%   87.58%   +1.34%     
==========================================
  Files          26       28       +2     
  Lines        1076     1144      +68     
==========================================
+ Hits          928     1002      +74     
+ Misses        148      142       -6     

☔ View full report in Codecov by Sentry.
📢 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.

@willingc willingc requested a review from psobolewskiPhD July 14, 2025 19:19
@jni
Copy link
Member

jni commented Jul 21, 2025

I actually think we don't need to worry too much about simul-dropping — if you are on 3.10 you'll simply get a slightly older napari-animation, but it'll work. Right?

@willingc willingc requested a review from psobolewskiPhD July 22, 2025 02:37
@jni
Copy link
Member

jni commented Jul 22, 2025

I'm a bit confused about the state of things here. Everything is green and most comments are addressed (I still think we don't need a nested if with NEEDS_ENUM_MEMBER and not HAS_ENUM_MEMBER, as they are mutually exclusive, but it doesn't hurt). But @willingc agreed with dropping Py3.10.

I think let's merge and then we make updates in follow-ups. Yes?

@willingc
Copy link
Contributor Author

willingc commented Jul 22, 2025

@jni I added back 3.10 for pyside for linux and window (no mac since I couldn't get it to work). I also updated the ci to output in the run name to have the qt_package displayed.

Let me go back (now that CI is green) and check the nested guard that you mention. Honestly, I spent most of my time fighting with tox and CI, as they were not as explicit as I would have expected. Thankfully, @psobolewskiPhD had the fail-fast toggled to false in his PR which ultimately unblocked me.

@willingc
Copy link
Contributor Author

@jni Removed the nested check and improved the naming of the guard variables. This should be ready to land. Thanks for the feedback.

@willingc willingc dismissed psobolewskiPhD’s stale review July 22, 2025 19:36

Addressed the suggestions made in the review.

@willingc
Copy link
Contributor Author

I'm going to merge this and see if it gets picked up by the new napari-hub.

@willingc willingc merged commit b4859be into napari:main Jul 23, 2025
18 checks passed
@willingc willingc deleted the update313 branch July 23, 2025 16:00
@psobolewskiPhD
Copy link
Member

Just a quick note: we really shouldn't drop py310 in this repo, because it will make it incompatible with pyside2. For the time being, we need to keep that for the bundle, until we move everything over to pyside6.
This is a key plugin that needs to work in the bundle.

@jni
Copy link
Member

jni commented Jul 24, 2025

@psobolewskiPhD the old version of napari-animation would still be available for the bundle if the bundle was on 3.10! But it's actually on 3.11!

napari/packaging#189

@psobolewskiPhD
Copy link
Member

Oh right conda-forge has somewhat newer packages!

@willingc
Copy link
Contributor Author

I only dropped 3.10 for mac and pyside. It should be available on other platforms. @psobolewskiPhD

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.

napari 0.6.2, py313, pyqt6: Easing related traceback, plugin can't be used

4 participants