-
-
Notifications
You must be signed in to change notification settings - Fork 412
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
Conversation
for more information, see https://pre-commit.ci
Codecov Report
@@ 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
|
napari/utils/_appdirs.py
Outdated
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
…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).
Some more changes:
|
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(), |
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
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?
|
||
if not running_as_bundled_app(): | ||
if not running_as_constructor_app(): | ||
process.setArguments(sys.argv) |
There was a problem hiding this comment.
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...
|
||
if sys.platform.startswith('linux') and running_as_bundled_app(): | ||
sys.path.append(user_site_packages()) | ||
|
||
def _initialize(self): |
There was a problem hiding this comment.
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.""" |
There was a problem hiding this comment.
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?
"""Infer whether we are running as a bundle.""" | |
"""Infer whether we are running as a briefcase bundle.""" |
Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
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 be nice, any difficulties you foresee in that 🤔 ? (I would not call not having that for constructor based installers a blocker) |
So why this option is disabled for non-bundle installs? |
It was initially suggested at #2540 (comment), but no clue about the context. |
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. |
Just to clarify: the restart thing was a Briefcase bundle only thing—which is why I've never seen it? |
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? |
# 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>
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>
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>
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>
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>
# 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>
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
How has this been tested?
Final checklist: