8000 Drop Python 3.8, add Python 3.12 testing by Czaki · Pull Request #6738 · napari/napari · GitHub
[go: up one dir, main page]

Skip to content

Drop Python 3.8, add Python 3.12 testing #6738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Mar 25, 2024
Merged

Conversation

Czaki
Copy link
Collaborator
@Czaki Czaki commented Mar 12, 2024

Description

Drop python 3.8 start testing on python 3.12

Also, automatically by pre-commit

  • a couple of parenthesized context managers
  • change to import from collections instead of typing for a bunch of types (like Sequence)
  • import part of things from typing instead of typing_extension (like Annotated).
  • one lru_cache to cache

@github-actions github-actions bot added tests Something related to our tests design Design and discussion about it qt Relates to qt topic:preferences Issues relating to the creation of new preference fields/panels maintenance PR with maintance changes, labels Mar 12, 2024
@Czaki Czaki added this to the 0.5.0 milestone Mar 12, 2024
@Czaki Czaki changed the title Drop python 3.8, python 3.12 testing Drop python 3.8, Python 3.12 testing Mar 12, 2024
@psobolewskiPhD
Copy link
Member

The union typing using | is python 3.10 and up?

@Czaki
Copy link
Collaborator Author
Czaki commented Mar 12, 2024

The union typing using | is python 3.10 and up?

In runtime, yes. Fixed now.

@Czaki Czaki changed the title Drop python 3.8, Python 3.12 testing Drop Python 3.8, add Python 3.12 testing Mar 12, 2024
Comment on lines -210 to +213
with mock.patch(
'napari._qt.qt_viewer.QFileDialog'
) as mock_file, mock.patch(
'napari._qt.qt_viewer.QtViewer._qt_open'
) as mock_read:
with (
mock.patch('napari._qt.qt_viewer.QFileDialog') as mock_file,
mock.patch('napari._qt.qt_viewer.QtViewer._qt_open') as mock_read,
):
Copy link
Member

Choose a reason for hiding this comment

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

❤️

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see that you spot one of your favorite python 3.9+ feature?

Copy link
Member

Choose a reason for hiding this comment

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

Hahaha indeed. Actually I was wondering why these are changed — is it because the file is newly reformatted? Or is the parens around with() actually a new syntax feature??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't know. I know that I have already read about this in the past, when we talked about ugly formatting, but cannot find now.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, it sounds like this was a Python 3.10 feature??? python/cpython#56991 is linked from https://docs.python.org/3/whatsnew/3.10.html. However I notice that it says "officially" allowed, so maybe it was unofficially working in 3.9 and we are now depending on that?

Anyway I think that we should drop 3.9 soon also anyway. (SPEC-0/NEP-29 already support this.)

8000
@@ -323,7 +323,7 @@ def get_layers_data(gui: CategoricalWidget) -> List[Tuple[str, Any]]:
return choices


@lru_cache(maxsize=None)
@cache
Copy link
Member

Choose a reason for hiding this comment

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

Also cool!

Copy link
codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 96.23824% with 24 lines in your changes are missing coverage. Please review.

Project coverage is 92.43%. Comparing base (ca5c031) to head (e162827).

Files Patch % Lines
napari/utils/stubgen.py 0.00% 6 Missing ⚠️
napari/utils/events/debugging.py 0.00% 5 Missing ⚠️
napari/components/experimental/monitor/_api.py 0.00% 3 Missing ⚠️
napari/_qt/widgets/qt_dict_table.py 0.00% 2 Missing ⚠️
napari/components/experimental/monitor/_service.py 0.00% 2 Missing ⚠️
napari/components/experimental/remote/_messages.py 0.00% 2 Missing ⚠️
napari/_qt/_tests/test_qt_viewer.py 66.66% 1 Missing ⚠️
napari/layers/_layer_actions.py 50.00% 1 Missing ⚠️
napari/plugins/_plugin_manager.py 92.30% 1 Missing ⚠️
napari/types.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6738      +/-   ##
==========================================
+ Coverage   92.37%   92.43%   +0.06%     
==========================================
  Files         613      613              
  Lines       54712    54727      +15     
==========================================
+ Hits        50540    50587      +47     
+ Misses       4172     4140      -32     

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

@Czaki
Copy link
Collaborator Author
Czaki commented Mar 12, 2024

Something is broken. I have pushed fixes, but I do not see them here (but they are visible on pull to another machine).

Copy link
Member
@jni jni left a comment

Choose a reason for hiding this comment

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

@Czaki these are weird? Do you need to run the constraints bot on this PR? Otherwise lgtm!

Screenshot 2024-03-13 at 10 38 18 am Screenshot 2024-03-13 at 10 38 34 am

@jni
Copy link
Member
jni commented Mar 12, 2024

oh just saw your comment. Hmmm. Yeah dunno, GH can be so bad with big changesets...

@Czaki
Copy link
Collaborator Author
Czaki commented Mar 12, 2024

@Czaki these are weird? Do you need to run the constraints bot on this PR? Otherwise lgtm!

Yes. At this moment, I put only empyt files for constraints. Once CI run again (I added upper pin for PySide6), I could download constraints and add non-empty version to this PR.

Copy link
Contributor
@brisvag brisvag left a comment

Choose a reason for hiding this comment

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

To summarize, the main changes are:

  • worfklows updated with new versions (as well as pyproject and tox.ini)
  • a couple of parenthesized context managers
  • a couple of "if version < 3.9" checks removed
  • everything else is a million changes from Tuple and List to tuple and list and so on.
  • one lru_cache to cache xD

did I miss something @Czaki ?

@@ -107,46 +107,51 @@ jobs:
fail-fast: false
matrix:
platform: [ ubuntu-latest ]
python: [ "3.9", "3.10" ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this 3.9 unchanged on purpose? I'm just scrolling through and notice this is the only one no bumped ^^

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I try to have working CI. And there is a PySide6/PySide2 problem

3.9: py39
3.9.0: py390
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this removal?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because we do not have any py390 job in tox

@Czaki
Copy link
Collaborator Author
Czaki commented Mar 14, 2024

did I miss something @Czaki ?

If you miss, I also miss such change introduced by ruff.

@psobolewskiPhD
Copy link
Member
psobolewskiPhD commented Mar 17, 2024

@Czaki The pyside 6.3.1 issue is a real "bug" in app-model related to the enum handling before 6.4 changes.
I have a fix:
https://github.com/psobolewskiPhD/app-model/tree/pyside_631_support
Do you think it's worth PR to app-model?

@Czaki
Copy link
Collaborator Author
Czaki commented Mar 17, 2024

Yes. Please add such PR with description and link to this PR.

@psobolewskiPhD
Copy link
Member

Yes. Please add such PR with description and link to this PR.

Done: pyapp-kit/app-model#179

@Czaki
Copy link
Collaborator Author
Czaki commented Mar 21, 2024

@napari-bot dependency update

@Czaki Czaki added the ready to merge Last chance for comments! Will be merged in ~24h label Mar 22, 2024
@jni
Copy link
Member
jni commented Mar 25, 2024

@Czaki can you confirm that @brisvag's summary here is accurate, and if so, update the PR description to match it?

@Czaki
Copy link
Collaborator Author
Czaki commented Mar 25, 2024

description updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Design and discussion about it maintenance PR with maintance changes, qt Relates to qt tests Something related to our tests topic:preferences Issues relating to the creation of new preference fields/panels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0