Skip to content
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

[MAINT, packaging] Remove support for briefcase installers #5804

Merged
merged 8 commits into from
May 24, 2023

Conversation

jaimergp
Copy link
Contributor

@jaimergp jaimergp commented May 4, 2023

Fixes/Closes

Closes #5506

Description

The Briefcase bundles have not been working for a while (at least in some platforms), nobody is testing them either, and our development efforts are mostly directed to the constructor installers.
In this PR, they are removed to avoid CI waste and permit deleting some strange code paths for Briefcase workarounds.

References

Type of change

  • Removes / deprecates code

How has this been tested?

  • No CI jobs for Briefcase
  • Tests pass without the extra Briefcase workarounds

Final checklist:

@github-actions github-actions bot added qt Relates to qt task labels May 4, 2023
@jaimergp jaimergp added the maintenance PR with maintance changes, label May 4, 2023
@jaimergp jaimergp changed the title Remove support for briefcase installers Remove support for briefcase installers (WIP) May 4, 2023
@codecov
Copy link

codecov bot commented May 4, 2023

Codecov Report

Merging #5804 (5458701) into main (436d983) will decrease coverage by 0.01%.
The diff coverage is 60.00%.

❗ Current head 5458701 differs from pull request most recent head ae412a9. Consider uploading reports for the commit ae412a9 to get more accurate results

@@            Coverage Diff             @@
##             main    #5804      +/-   ##
==========================================
- Coverage   89.86%   89.86%   -0.01%     
==========================================
  Files         614      614              
  Lines       52210    52190      -20     
==========================================
- Hits        46918    46900      -18     
+ Misses       5292     5290       -2     
Impacted Files Coverage Δ
napari/plugins/__init__.py 93.54% <ø> (-0.74%) ⬇️
napari/utils/_appdirs.py 82.14% <0.00%> (+5.47%) ⬆️
napari/utils/misc.py 84.41% <ø> (+1.36%) ⬆️
napari/_qt/dialogs/qt_package_installer.py 87.35% <100.00%> (+0.28%) ⬆️
napari/plugins/_plugin_manager.py 76.08% <100.00%> (+0.01%) ⬆️

... and 15 files with indirect coverage changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Many functions on this module are Briefcase-specific adjustments. We might just remove them, but I wonder if we have to follow a deprecation policy for these?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a private module. Did they are exposed from non-private ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't check so I don't know, but I honestly hope they are not being used by any other project.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Even if other project uses it but importing from a private module then it is not our problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAIK the only user is the plugin manager dialog which we control fully, so we are good. I removed those functions because they are not needed anymore in the PipInstaller workarounds.

@jaimergp jaimergp marked this pull request as ready for review May 5, 2023 09:43
…or_app()

Sometimes the intent is to check whether we are in an installer-provided installation, not to check for Briefcase itself (for technical workarounds, not UX ones).
@jaimergp
Copy link
Contributor Author

Some more changes:

  • I removed most of _appdirs custom functions because the only usage was the Plugin Manager dialog, where workarounds for Briefcase were implemented. We don't need those anymore!
  • I removed the usage of running_as_bundled_app() and replaced it with running_as_constructor_app() where necessary, but there are some places were I don't know if the check was done for UX purposes or the necessity of technical workarounds. I'll need feedback here! (Questions inline below).

return (*args, *self.pkgs)

def environment(
self, env: QProcessEnvironment = None
) -> QProcessEnvironment:
if env is None:
env = QProcessEnvironment.systemEnvironment()
combined_paths = os.pathsep.join(
[
user_site_packages(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was only used in Briefcase, AFAIK. There's no plugins/ installation directory anywhere else, right?

@@ -123,7 +123,7 @@ def __init__(self, window: 'Window') -> None:
'shortcut': 'Ctrl+W',
},
{
'when': running_as_bundled_app(),
'when': running_as_constructor_app(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is the Restart button a UX feature or something we needed in Briefcase for XYZ reasons?

Comment on lines 517 to 519

if not running_as_bundled_app():
if not running_as_constructor_app():
process.setArguments(sys.argv)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure why this is avoided in bundled apps, but 🤷 We might even want the sys.argv stuff in the constructor apps. We use the python -m napari syntax to launch those, and those scripts are called by specific platform launchers for OS integrations...

The broader question is... do we even need a Restart button now? It was only used with Briefcase, apparently...

Comment on lines 97 to 98

if sys.platform.startswith('linux') and running_as_bundled_app():
sys.path.append(user_site_packages())

def _initialize(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bye to this hack :D user_site_packages() was something like {sys.prefix}/plugins/lib/pythonX.Y/site-packages in Briefcase, I think, but nowhere else!

@@ -51,17 +51,26 @@ def parse_version(v) -> 'packaging.version._BaseVersion':


def running_as_bundled_app(*, check_conda=True) -> bool:
"""Infer whether we are running as a briefcase bundle."""
"""Infer whether we are running as a bundle."""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that we are deprecating this function... I guess I need to revert this?

Suggested change
"""Infer whether we are running as a bundle."""
"""Infer whether we are running as a briefcase bundle."""

napari/utils/misc.py Outdated Show resolved Hide resolved
@Czaki Czaki added this to the 0.4.18 milestone May 15, 2023
napari/utils/misc.py Outdated Show resolved Hide resolved
Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
@jaimergp jaimergp changed the title Remove support for briefcase installers (WIP) Remove support for briefcase installers May 15, 2023
@Czaki Czaki added the ready to merge Last chance for comments! Will be merged in ~24h label May 16, 2023
@jaimergp
Copy link
Contributor Author

The restart functionality was added in #2540. @goanpeca - do you remember what was the rationale for this feature? Would we need that in constructor-based bundles too?

@goanpeca
Copy link
Contributor

Hi @jaimergp, so at the moment some preference options required a restart, so that is why that option was added. I believe with @kcpevey (async preferences) work this will no longer be necessary. However restart will still be required when for example, language settings are updated. Now we can decide if the UI is just "you will need to close and restart" or if we continue to handle it for the user with "click yes to restart" or similar.

Would we need that in constructor-based bundles too?

Would be nice, any difficulties you foresee in that 🤔 ? (I would not call not having that for constructor based installers a blocker)

@Czaki
Copy link
Collaborator

Czaki commented May 19, 2023

So why this option is disabled for non-bundle installs?

@jaimergp
Copy link
Contributor Author

jaimergp commented May 19, 2023

It was initially suggested at #2540 (comment), but no clue about the context.

@psobolewskiPhD
Copy link
Member

Now we can decide if the UI is just "you will need to close and restart" or if we continue to handle it for the user with "click yes to restart" or similar.

We already have a pop-up style message for install/uninstall of npe2 plugins, without a restart button. I think as long as it's clear that the preference requires it then I think quit and relaunch is not a hard/foreign concept.

@psobolewskiPhD
Copy link
Member

Just to clarify: the restart thing was a Briefcase bundle only thing—which is why I've never seen it?
Looking at the other PR it looks like it's an extra File menu item Restart. I've never seen that in any GUI app I use, so I'd vote to totally remove it and if we want that feature to be a napari feature we can add it back.

@Czaki
Copy link
Collaborator

Czaki commented May 23, 2023

Because of the current failures of CI, I would like to merge this and move the discussion about restarting to Issue/followup PR.

@napari/copy could you check it?

@psobolewskiPhD psobolewskiPhD changed the title Remove support for briefcase installers [MAINT, packaging] Remove support for briefcase installers May 24, 2023
@psobolewskiPhD
Copy link
Member

@Czaki @jaimergp I tweaked the wording a bit, hope it's ok.

@Czaki Czaki merged commit d4ba4a0 into napari:main May 24, 2023
28 checks passed
@Czaki Czaki removed the ready to merge Last chance for comments! Will be merged in ~24h label May 25, 2023
psobolewskiPhD added a commit to napari/docs that referenced this pull request May 30, 2023
# Description

The briefcase bundle has been broken and has been removed by napari PR: napari/napari#5804
This PR removes mention of this bundle from the user-facing installation docs.

## Type of change
- [X] Removes outdated documentation

# References

Depends on napari/napari#5804

## Final checklist:
- [x] My PR is the minimum possible work for the desired functionality

---------

Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Co-authored-by: Kira Evans <contact@kne42.me>
Czaki added a commit that referenced this pull request Jun 19, 2023
Closes #5506

The Briefcase bundles have not been working for a while (at least in
some platforms), nobody is testing them either, and our development
efforts are mostly directed to the `constructor` installers.
In this PR, they are removed to [avoid CI
waste](#5660) and permit deleting
some strange code paths for Briefcase workarounds.

- [X] Removes / deprecates code

<!-- Please describe the tests that you ran to verify your changes. -->
- [x] No CI jobs for Briefcase
- [x] Tests pass without the extra Briefcase workarounds

- [X] My PR is the minimum possible work for the desired functionality
- [x] I have made corresponding changes to the documentation:
napari/docs#147

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
Czaki added a commit that referenced this pull request Jun 21, 2023
Closes #5506

The Briefcase bundles have not been working for a while (at least in
some platforms), nobody is testing them either, and our development
efforts are mostly directed to the `constructor` installers.
In this PR, they are removed to [avoid CI
waste](#5660) and permit deleting
some strange code paths for Briefcase workarounds.

- [X] Removes / deprecates code

<!-- Please describe the tests that you ran to verify your changes. -->
- [x] No CI jobs for Briefcase
- [x] Tests pass without the extra Briefcase workarounds

- [X] My PR is the minimum possible work for the desired functionality
- [x] I have made corresponding changes to the documentation:
napari/docs#147

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
Czaki added a commit that referenced this pull request Jun 21, 2023
Closes #5506

The Briefcase bundles have not been working for a while (at least in
some platforms), nobody is testing them either, and our development
efforts are mostly directed to the `constructor` installers.
In this PR, they are removed to [avoid CI
waste](#5660) and permit deleting
some strange code paths for Briefcase workarounds.

- [X] Removes / deprecates code

<!-- Please describe the tests that you ran to verify your changes. -->
- [x] No CI jobs for Briefcase
- [x] Tests pass without the extra Briefcase workarounds

- [X] My PR is the minimum possible work for the desired functionality
- [x] I have made corresponding changes to the documentation:
napari/docs#147

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
Czaki added a commit that referenced this pull request Jun 21, 2023
Closes #5506

The Briefcase bundles have not been working for a while (at least in
some platforms), nobody is testing them either, and our development
efforts are mostly directed to the `constructor` installers.
In this PR, they are removed to [avoid CI
waste](#5660) and permit deleting
some strange code paths for Briefcase workarounds.

- [X] Removes / deprecates code

<!-- Please describe the tests that you ran to verify your changes. -->
- [x] No CI jobs for Briefcase
- [x] Tests pass without the extra Briefcase workarounds

- [X] My PR is the minimum possible work for the desired functionality
- [x] I have made corresponding changes to the documentation:
napari/docs#147

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
Czaki pushed a commit that referenced this pull request Jun 24, 2023
# Description

The briefcase bundle has been broken and has been removed by napari PR: #5804
This PR removes mention of this bundle from the user-facing installation docs.

## Type of change
- [X] Removes outdated documentation

# References

Depends on #5804

## Final checklist:
- [x] My PR is the minimum possible work for the desired functionality

---------

Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Co-authored-by: Kira Evans <contact@kne42.me>
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 task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

napari .zip briefcase bundled app does not work (windows, macOS)
4 participants