napari-plugin-manager 0.1.9rc0__py3-none-any.whl → 0.1.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- napari_plugin_manager/_tests/test_installer_process.py +5 -5
- napari_plugin_manager/_version.py +2 -2
- napari_plugin_manager/base_qt_package_installer.py +9 -2
- napari_plugin_manager/base_qt_plugin_dialog.py +0 -5
- napari_plugin_manager/npe2api.py +11 -5
- napari_plugin_manager/qt_plugin_dialog.py +10 -2
- {napari_plugin_manager-0.1.9rc0.dist-info → napari_plugin_manager-0.1.10.dist-info}/METADATA +1 -1
- {napari_plugin_manager-0.1.9rc0.dist-info → napari_plugin_manager-0.1.10.dist-info}/RECORD +11 -11
- {napari_plugin_manager-0.1.9rc0.dist-info → napari_plugin_manager-0.1.10.dist-info}/WHEEL +1 -1
- {napari_plugin_manager-0.1.9rc0.dist-info → napari_plugin_manager-0.1.10.dist-info}/licenses/LICENSE +0 -0
- {napari_plugin_manager-0.1.9rc0.dist-info → napari_plugin_manager-0.1.10.dist-info}/top_level.txt +0 -0
|
@@ -261,7 +261,7 @@ def test_conda_installer(qtbot, caplog, monkeypatch, tmp_conda_env: Path):
|
|
|
261
261
|
caplog.set_level(logging.DEBUG, logger=bqpi.__name__)
|
|
262
262
|
conda_meta = tmp_conda_env / 'conda-meta'
|
|
263
263
|
glob_pat = 'typing-extensions-*.json'
|
|
264
|
-
glob_pat_2 = '
|
|
264
|
+
glob_pat_2 = 'cowpy-*.json'
|
|
265
265
|
installer = NapariInstallerQueue()
|
|
266
266
|
|
|
267
267
|
with qtbot.waitSignal(installer.allFinished, timeout=600_000):
|
|
@@ -293,7 +293,7 @@ def test_conda_installer(qtbot, caplog, monkeypatch, tmp_conda_env: Path):
|
|
|
293
293
|
)
|
|
294
294
|
installer.install(
|
|
295
295
|
tool=InstallerTools.CONDA,
|
|
296
|
-
pkgs=['
|
|
296
|
+
pkgs=['cowpy'],
|
|
297
297
|
prefix=tmp_conda_env,
|
|
298
298
|
)
|
|
299
299
|
assert installer.currentJobs() == 2
|
|
@@ -312,7 +312,7 @@ def test_conda_installer(qtbot, caplog, monkeypatch, tmp_conda_env: Path):
|
|
|
312
312
|
)
|
|
313
313
|
job_id_2 = installer.install(
|
|
314
314
|
tool=InstallerTools.CONDA,
|
|
315
|
-
pkgs=['
|
|
315
|
+
pkgs=['cowpy'],
|
|
316
316
|
prefix=tmp_conda_env,
|
|
317
317
|
)
|
|
318
318
|
assert installer.currentJobs() == 2
|
|
@@ -330,7 +330,7 @@ def test_conda_installer(qtbot, caplog, monkeypatch, tmp_conda_env: Path):
|
|
|
330
330
|
)
|
|
331
331
|
job_id_2 = installer.install(
|
|
332
332
|
tool=InstallerTools.CONDA,
|
|
333
|
-
pkgs=['
|
|
333
|
+
pkgs=['cowpy'],
|
|
334
334
|
prefix=tmp_conda_env,
|
|
335
335
|
)
|
|
336
336
|
assert installer.currentJobs() == 2
|
|
@@ -370,7 +370,7 @@ def test_conda_installer_wait_for_finished(qtbot, tmp_conda_env: Path):
|
|
|
370
370
|
)
|
|
371
371
|
installer.install(
|
|
372
372
|
tool=InstallerTools.CONDA,
|
|
373
|
-
pkgs=['
|
|
373
|
+
pkgs=['cowpy'],
|
|
374
374
|
prefix=tmp_conda_env,
|
|
375
375
|
)
|
|
376
376
|
installer.waitForFinished(30_000)
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.1.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 1,
|
|
31
|
+
__version__ = version = '0.1.10'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 1, 10)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -26,7 +26,6 @@ from subprocess import run
|
|
|
26
26
|
from tempfile import gettempdir
|
|
27
27
|
from typing import TypedDict
|
|
28
28
|
|
|
29
|
-
from napari.plugins import plugin_manager
|
|
30
29
|
from napari.plugins.npe2api import _user_agent
|
|
31
30
|
from napari.utils.misc import StringEnum
|
|
32
31
|
from napari.utils.translations import trans
|
|
@@ -694,7 +693,15 @@ class InstallerQueue(QObject):
|
|
|
694
693
|
and exit_code == 0
|
|
695
694
|
):
|
|
696
695
|
pm2 = PluginManager.instance()
|
|
697
|
-
|
|
696
|
+
# new versions of napari after 0.7.0 won't have the plugin_manager
|
|
697
|
+
# this try/except block is to maintain compatibility
|
|
698
|
+
# between new napari-plugin-manager versions and old napari versions
|
|
699
|
+
try:
|
|
700
|
+
from napari.plugins import plugin_manager
|
|
701
|
+
|
|
702
|
+
npe1_plugins = set(plugin_manager.iter_available())
|
|
703
|
+
except ImportError:
|
|
704
|
+
npe1_plugins = set()
|
|
698
705
|
for pkg in current.pkgs:
|
|
699
706
|
if pkg in pm2:
|
|
700
707
|
pm2.unregister(pkg)
|
|
@@ -1471,13 +1471,10 @@ class BaseQtPluginDialog(QDialog):
|
|
|
1471
1471
|
self.working_indicator.setMovie(mov)
|
|
1472
1472
|
mov.start()
|
|
1473
1473
|
|
|
1474
|
-
visibility_direct_entry = not self._on_bundle()
|
|
1475
1474
|
self.direct_entry_edit = QLineEdit(self)
|
|
1476
1475
|
self.direct_entry_edit.installEventFilter(self)
|
|
1477
1476
|
self.direct_entry_edit.returnPressed.connect(self._install_packages)
|
|
1478
|
-
self.direct_entry_edit.setVisible(visibility_direct_entry)
|
|
1479
1477
|
self.direct_entry_btn = QToolButton(self)
|
|
1480
|
-
self.direct_entry_btn.setVisible(visibility_direct_entry)
|
|
1481
1478
|
self.direct_entry_btn.clicked.connect(self._install_packages)
|
|
1482
1479
|
self.direct_entry_btn.setText(self._trans('Install'))
|
|
1483
1480
|
|
|
@@ -1518,8 +1515,6 @@ class BaseQtPluginDialog(QDialog):
|
|
|
1518
1515
|
|
|
1519
1516
|
buttonBox.addWidget(self.direct_entry_edit)
|
|
1520
1517
|
buttonBox.addWidget(self.direct_entry_btn)
|
|
1521
|
-
if not visibility_direct_entry:
|
|
1522
|
-
buttonBox.addStretch()
|
|
1523
1518
|
buttonBox.addWidget(self.process_success_indicator)
|
|
1524
1519
|
buttonBox.addWidget(self.process_error_indicator)
|
|
1525
1520
|
buttonBox.addWidget(self.show_status_btn)
|
napari_plugin_manager/npe2api.py
CHANGED
|
@@ -23,6 +23,10 @@ from napari_plugin_manager.utils import get_homepage_url
|
|
|
23
23
|
|
|
24
24
|
PyPIname = str
|
|
25
25
|
|
|
26
|
+
BASE_API_URL = 'https://api.napari.org/api'
|
|
27
|
+
EXTENDED_SUMMARY_URL = f'{BASE_API_URL}/extended_summary'
|
|
28
|
+
CONDA_URL = f'{BASE_API_URL}/conda'
|
|
29
|
+
|
|
26
30
|
|
|
27
31
|
@lru_cache
|
|
28
32
|
def _user_agent() -> str:
|
|
@@ -51,7 +55,7 @@ def _user_agent() -> str:
|
|
|
51
55
|
|
|
52
56
|
|
|
53
57
|
class _ShortSummaryDict(TypedDict):
|
|
54
|
-
"""Objects returned
|
|
58
|
+
"""Objects returned from API extended_summary endpoint."""
|
|
55
59
|
|
|
56
60
|
name: NotRequired[PyPIname]
|
|
57
61
|
version: str
|
|
@@ -70,16 +74,18 @@ class SummaryDict(_ShortSummaryDict):
|
|
|
70
74
|
@lru_cache
|
|
71
75
|
def plugin_summaries() -> list[SummaryDict]:
|
|
72
76
|
"""Return PackageMetadata object for all known napari plugins."""
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
with urlopen(
|
|
78
|
+
Request(EXTENDED_SUMMARY_URL, headers={'User-Agent': _user_agent()})
|
|
79
|
+
) as resp:
|
|
75
80
|
return json.load(resp)
|
|
76
81
|
|
|
77
82
|
|
|
78
83
|
@lru_cache
|
|
79
84
|
def conda_map() -> dict[PyPIname, str | None]:
|
|
80
85
|
"""Return map of PyPI package name to conda_channel/package_name ()."""
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
with urlopen(
|
|
87
|
+
Request(CONDA_URL, headers={'User-Agent': _user_agent()})
|
|
88
|
+
) as resp:
|
|
83
89
|
return json.load(resp)
|
|
84
90
|
|
|
85
91
|
|
|
@@ -104,12 +104,20 @@ class PluginListItem(BasePluginListItem):
|
|
|
104
104
|
if plugin_name in pm2:
|
|
105
105
|
pm2.enable(plugin_name) if state else pm2.disable(plugin_name)
|
|
106
106
|
return
|
|
107
|
-
|
|
107
|
+
# new versions of napari after 0.7.0 won't have the plugin_manager
|
|
108
|
+
# this try/except block is to maintain compatibility
|
|
109
|
+
# between new napari-plugin-manager versions and old napari versions
|
|
110
|
+
try:
|
|
111
|
+
from napari.plugins import plugin_manager
|
|
112
|
+
|
|
113
|
+
npe1_plugins = set(plugin_manager.iter_available())
|
|
114
|
+
except ImportError:
|
|
115
|
+
npe1_plugins = set()
|
|
108
116
|
for (
|
|
109
117
|
npe1_name,
|
|
110
118
|
_,
|
|
111
119
|
distname,
|
|
112
|
-
) in
|
|
120
|
+
) in npe1_plugins:
|
|
113
121
|
if distname and (normalized_name(distname) == plugin_name):
|
|
114
122
|
napari.plugins.plugin_manager.set_blocked(
|
|
115
123
|
npe1_name, not enabled
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
napari_plugin_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
napari_plugin_manager/_version.py,sha256=
|
|
3
|
-
napari_plugin_manager/base_qt_package_installer.py,sha256=
|
|
4
|
-
napari_plugin_manager/base_qt_plugin_dialog.py,sha256=
|
|
5
|
-
napari_plugin_manager/npe2api.py,sha256=
|
|
2
|
+
napari_plugin_manager/_version.py,sha256=uf7mpKSLRNNF3RxSXHssYzKadEgmCS7IlRw4lFPAcUg,706
|
|
3
|
+
napari_plugin_manager/base_qt_package_installer.py,sha256=AgCQtCjzTgzR-by_Csrr8MVaCDoWPQgESY9SG-PKpCE,24883
|
|
4
|
+
napari_plugin_manager/base_qt_plugin_dialog.py,sha256=XLRQJ-qqNgry4RMvor20hXNp02pkcNcw_PY2OwL9P58,67168
|
|
5
|
+
napari_plugin_manager/npe2api.py,sha256=IfAkr3HNEUnqhHJgeCKm6kvkm7mUaLLMRjXwSJXcPq8,4416
|
|
6
6
|
napari_plugin_manager/qt_package_installer.py,sha256=QFQDED3MKbQupKF7OjBPz70cK2zrgIP2gu4vdUVV8Tk,3511
|
|
7
|
-
napari_plugin_manager/qt_plugin_dialog.py,sha256=
|
|
7
|
+
napari_plugin_manager/qt_plugin_dialog.py,sha256=8YY9RJBgHnhZJpVtwxSjY0V5xXB3tpnlx5Hv0MIS8H8,10692
|
|
8
8
|
napari_plugin_manager/qt_warning_dialog.py,sha256=DtPoFBn7zDfSmkdMokm1BcuoYasngkC0jwJok-oIuGk,727
|
|
9
9
|
napari_plugin_manager/qt_widgets.py,sha256=OatVQPuJFP5sgYRq_KiaynwXI3UfLGiTwBRlFy-b5mk,399
|
|
10
10
|
napari_plugin_manager/styles.qss,sha256=2oJBNiLT3YtqQP3avQGAOWcSSOZiFHGDsHtI5TjjxuA,7928
|
|
@@ -12,12 +12,12 @@ napari_plugin_manager/utils.py,sha256=vGvOndyiwc_JaSHVtXIc9z-dGsewo_vRb31U-26vy2
|
|
|
12
12
|
napari_plugin_manager/_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
napari_plugin_manager/_tests/conftest.py,sha256=Bm8u6hT5-mQXaxamke79tJGrU8BZA3V444YBLPivVr8,1885
|
|
14
14
|
napari_plugin_manager/_tests/test_base_installer_process.py,sha256=Cv-nBnUeNAX6pYUE1zs38I9vGtCE-ahBN4q-xcBH-pw,561
|
|
15
|
-
napari_plugin_manager/_tests/test_installer_process.py,sha256=
|
|
15
|
+
napari_plugin_manager/_tests/test_installer_process.py,sha256=xWK5xyini6L0rEvwxTacz-JCTODGqUga9fpaUr7KiuY,12801
|
|
16
16
|
napari_plugin_manager/_tests/test_npe2api.py,sha256=ncBGWHrA5uZjmt6w4lVlx8D-n_3At1bfAZgkMRxK7Lg,1275
|
|
17
17
|
napari_plugin_manager/_tests/test_qt_plugin_dialog.py,sha256=Rcfaho94vM7iwumU4n6ygyP5O3E7lsXIpoAwpXmI2YA,20702
|
|
18
18
|
napari_plugin_manager/_tests/test_utils.py,sha256=rAlqp8y1MR3U4nWCN1jekbvP_avket3fVgEQwJDqpKk,1674
|
|
19
|
-
napari_plugin_manager-0.1.
|
|
20
|
-
napari_plugin_manager-0.1.
|
|
21
|
-
napari_plugin_manager-0.1.
|
|
22
|
-
napari_plugin_manager-0.1.
|
|
23
|
-
napari_plugin_manager-0.1.
|
|
19
|
+
napari_plugin_manager-0.1.10.dist-info/licenses/LICENSE,sha256=8dAlKbOqTMYe9L-gL_kEx5Xr1Sd0AbaWQDUkpiOp3vI,1506
|
|
20
|
+
napari_plugin_manager-0.1.10.dist-info/METADATA,sha256=2ApKs8AueZ6fnQ-yHKt2chDXgyAirWQnzoPdqJEyvNw,12156
|
|
21
|
+
napari_plugin_manager-0.1.10.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
22
|
+
napari_plugin_manager-0.1.10.dist-info/top_level.txt,sha256=pmCqLetuumhY1CKSuTZ5eQsitzazrSvc7V_mkugEPTY,22
|
|
23
|
+
napari_plugin_manager-0.1.10.dist-info/RECORD,,
|
{napari_plugin_manager-0.1.9rc0.dist-info → napari_plugin_manager-0.1.10.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{napari_plugin_manager-0.1.9rc0.dist-info → napari_plugin_manager-0.1.10.dist-info}/top_level.txt
RENAMED
|
File without changes
|