8000 Simplify constraints configuration by Czaki · Pull Request #7642 · napari/napari · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Simplify constraints configuration #7642

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 1 commit into from
Feb 27, 2025
Merged

Conversation

Czaki
Copy link
Collaborator
@Czaki Czaki commented Feb 24, 2025

Description

There are three changes here.

  1. stop cloning docs repo as we are using extension group (Add optional dependency sections for gallery and docs #7487).
  2. change directory to napari repo so commands on the top of constraints files
    napari/resources/constraints/constraints_py3.10.txt(
    # uv pip compile --python-version 3.10 --output-file napari_repo/resources/constraints/constraints_py3.10.txt napari_repo/pyproject.toml napari_repo/resources/constraints/version_denylist.txt --extra pyqt5 --extra pyqt6 --extra pyside2 --extra pyside6_experimental --extra testing --extra testing_extra --extra optional

    could be easier executed locally as there will be no napari_repo in the path. That will allow to easier recalculate constraints locally.
  3. remove PyQt5 from constraints, as there is no single PyQt5 version that provides wheels for both windows and macOS ARM. This simplifies maintenance and local bumping. As PyQt5 is in maintenance mode, I do not expect that PyQt5 may break anything and removing it from constraints allows removing separate Windows files.

With these changes, it will be easier to run update of constraints locally.

@Czaki Czaki added the maintenance PR with maintance changes, label Feb 24, 2025
@Czaki Czaki requested a review from a team as a code owner February 24, 2025 11:30
Copy link
codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.86%. Comparing base (39b385d) to head (6ed146e).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7642      +/-   ##
==========================================
- Coverage   92.87%   92.86%   -0.02%     
==========================================
  Files         630      630              
  Lines       58995    59205     +210     
==========================================
+ Hits        54791    54979     +188     
- Misses       4204     4226      +22     

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

Copy link
Collaborator
@willingc willingc left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @Czaki. +1 for simplifying complexity in CI config.

8000

@TimMonko
Copy link
Contributor
TimMonko commented Feb 25, 2025

@Czaki, can you explain what this changes a little bit more? Is the goal to not have to parse a separate set of constraints for windows? If so, isn't part of the goal of the constraints to get the correct PyQt5 version? I have found that even with the constraints sometimes installing on Windows goes a bit sideways with both pip and conda, and often some type of pyqt-related package gets the wrong version grabbed. Will that fix this, or potentially make the problem worse?

If there is a way I can help test what this changes, please let me know. Or are constraints just for CI? (haven't totally figured this stuff out yet, since I'm used to things being declared in pyproject)

@Czaki
Copy link
Collaborator Author
Czaki commented Feb 25, 2025

@TimMonko There are three changes here.

  1. stop cloning docs repo as we are using extension group (Add optional dependency sections for gallery and docs #7487).
  2. change directory to napari repo so commands on the top of constraints files
    # uv pip compile --python-version 3.10 --output-file napari_repo/resources/constraints/constraints_py3.10.txt napari_repo/pyproject.toml napari_repo/resources/constraints/version_denylist.txt --extra pyqt5 --extra pyqt6 --extra pyside2 --extra pyside6_experimental --extra testing --extra testing_extra --extra optional

    could be easier executed locally as there will be no napari_repo in the path. That will allow to easier recalculate constraints locally.
  3. remove PyQt5 from constraints, as there is no single PyQt5 version that provides wheels for both windows and macOS ARM. This simplifies maintenance and local bumping.

I have found that even with the constraints sometimes installing on Windows goes a bit sideways with both pip and conda, and often some type of pyqt-related package gets the wrong version grabbed

Could you elaborate more? At first, constraints are designed for pure pip (or uv) installation. And in such a situation I do not know how with constraints, the wrong version of Qt may be picked.

If there is a way I can help test what this changes, please let me know. Or are constraints just for CI? (haven't totally figured this stuff out yet, since I'm used to things being declared in pyproject)

The main target of constraints is to stabilize CI. For example, some package release may break our tests. Without constraints, such release break development of all actively developed PR. With constraints, the PRs are untouched, and we could fix problems in constraints PR or report a bug to upstream and mark the version as broken.

Moreover, the user may use constraints to install napari in a tested version of requirements. I expect that it may be mainly useful for someone who would like to install older napari version.

But I do not expect that lack of pinning of PyQt5 may be problematic, but maybe you have another experience.

PyQt5 maintainer wrote this on mailing list:

Normally the Qt wheels are created from an installation that itself was
created by the Qt online installer. This is because Qt is a pain to
build from source (specifically to get all the dependencies right).
However newer relea 8000 ses of Qt v5.15 no longer included in the online
installer and only available as source packages. I was happy to stick
with the last version that was included (v5.15.2) but then I wanted to
support PyQt5 on Apple silicon (my development platform). This meant
using a later version of v5.15 and having to build from source. Later on
I chose to build from source for Linux as well. I still plan to do the
same for Windows but haven't got round to it yet.

@github-actions github-actions bot added the qt Relates to qt label Feb 26, 2025
@Czaki Czaki force-pushed the simplify_constraints branch from 6e2c962 to 6ed146e Compare February 26, 2025 16:50
@Czaki Czaki mentioned this pull request Feb 26, 2025
@TimMonko
Copy link
Contributor

Could you elaborate more? At first, constraints are designed for pure pip (or uv) installation. And in such a situation I do not know how with constraints, the wrong version of Qt may be picked.

I think, partly, I'm misunderstanding constraints usage. But also, realizing that in many of the bad solves they are on undergraduate's devices; I'm guessing they are running into having previous installs on their device, like in #7646 . Then, it works for them only in some python versions but not others, due to conflicts of what/how they installed for classes.

Copy link
Member
@psobolewskiPhD psobolewskiPhD left a comment

Choose a reason for hiding this comment

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

how about copy the explanation post to the OP?
I found it very helpful, maybe future code archeologists might as well?

@psobolewskiPhD psobolewskiPhD added the ready to merge Last chance for comments! Will be merged in ~24h label Feb 26, 2025
@psobolewskiPhD psobolewskiPhD added this to the 0.6.0 milestone Feb 26, 2025
@Czaki
Copy link
Collaborator Author
Czaki commented Feb 27, 2025

how about copy the explanation post to the OP?

Whole or only part?

Could You edit the description to add missed information?

@jni jni merged commit 028612d into napari:main Feb 27, 2025
77 checks passed
@jni jni deleted the simplify_constraints branch February 27, 2025 01:46
@github-actions github-actions bot removed the ready to merge Last chance for comments! Will be merged in ~24h label Feb 27, 2025
@willingc
Copy link
Collaborator

@Czaki @psobolewskiPhD @TimMonko @jni I love the teamwork on this PR. Great job sharing knowledge about changes. 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance PR with maintance changes, qt Relates to qt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0