From 36ed09f8bbd541612e2c16f8483e51f57a876ba6 Mon Sep 17 00:00:00 2001 From: Nathan Clack Date: Fri, 15 Sep 2023 14:24:39 -0700 Subject: [PATCH 1/6] update hub api --- src/npe2/_inspection/_fetch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/npe2/_inspection/_fetch.py b/src/npe2/_inspection/_fetch.py index d6577b96..a0d259b3 100644 --- a/src/npe2/_inspection/_fetch.py +++ b/src/npe2/_inspection/_fetch.py @@ -408,7 +408,7 @@ def get_pypi_plugins() -> Dict[str, str]: @lru_cache def get_hub_plugins() -> Dict[str, str]: """Return {name: latest_version} for all plugins on the hub.""" - with request.urlopen("https://api.napari-hub.org/plugins") as r: + with request.urlopen("https://api.napari-hub.org/plugins/index/all") as r: return json.load(r) From 0d23afbfbbf2fb2ba0e6ad37d235de5a82cfd689 Mon Sep 17 00:00:00 2001 From: Nathan Clack Date: Fri, 15 Sep 2023 16:05:49 -0700 Subject: [PATCH 2/6] fix deprecation: build.env.IsolatedEnvBuilder --- src/npe2/_inspection/_full_install.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/npe2/_inspection/_full_install.py b/src/npe2/_inspection/_full_install.py index 32862ee1..27f59cdc 100644 --- a/src/npe2/_inspection/_full_install.py +++ b/src/npe2/_inspection/_full_install.py @@ -58,9 +58,9 @@ def isolated_plugin_env( """ # it's important that this import be lazy, otherwise we'll get a circular # import when serving as a setuptools plugin with `python -m build` - from build.env import IsolatedEnvBuilder + from build.env import DefaultIsolatedEnv - with IsolatedEnvBuilder() as env: + with DefaultIsolatedEnv() as env: # install the package pkg = f"{package}=={version}" if version else package logger.debug(f"installing {pkg} into virtual env") From 172a99e074ceaf2637357cf82a797f4746a8365a Mon Sep 17 00:00:00 2001 From: Nathan Clack Date: Sun, 17 Sep 2023 14:22:56 -0700 Subject: [PATCH 3/6] remove unused get_hub_plugins() method and test --- src/npe2/_inspection/_fetch.py | 7 ------- tests/test_fetch.py | 5 ----- 2 files changed, 12 deletions(-) diff --git a/src/npe2/_inspection/_fetch.py b/src/npe2/_inspection/_fetch.py index a0d259b3..98e6517b 100644 --- a/src/npe2/_inspection/_fetch.py +++ b/src/npe2/_inspection/_fetch.py @@ -405,13 +405,6 @@ def get_pypi_plugins() -> Dict[str, str]: return _get_packages_by_classifier(NAPARI_CLASSIFIER) -@lru_cache -def get_hub_plugins() -> Dict[str, str]: - """Return {name: latest_version} for all plugins on the hub.""" - with request.urlopen("https://api.napari-hub.org/plugins/index/all") as r: - return json.load(r) - - @lru_cache def get_hub_plugin(plugin_name: str) -> Dict[str, Any]: """Return hub information for a specific plugin.""" diff --git a/tests/test_fetch.py b/tests/test_fetch.py index 48f7fee8..de008de0 100644 --- a/tests/test_fetch.py +++ b/tests/test_fetch.py @@ -93,11 +93,6 @@ def test_get_manifest_from_wheel(tmp_path): assert mf.name == "affinder" -def test_get_hub_plugins(): - plugins = get_hub_plugins() - assert len(plugins) > 0 - - def test_get_hub_plugin(): info = get_hub_plugin("napari-svg") assert info["name"] == "napari-svg" From 4803be70f211a675b8540ff62bc084c5beac0fd1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 21:23:10 +0000 Subject: [PATCH 4/6] style: [pre-commit.ci] auto fixes [...] --- tests/test_fetch.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_fetch.py b/tests/test_fetch.py index de008de0..6f03f377 100644 --- a/tests/test_fetch.py +++ b/tests/test_fetch.py @@ -9,7 +9,6 @@ from npe2._inspection._fetch import ( _manifest_from_pypi_sdist, get_hub_plugin, - get_hub_plugins, get_manifest_from_wheel, get_pypi_plugins, get_pypi_url, From 81a5af38f7739113fec27960733bbcdc28c24a9f Mon Sep 17 00:00:00 2001 From: Nathan Clack Date: Sun, 17 Sep 2023 14:25:13 -0700 Subject: [PATCH 5/6] fix --- src/npe2/_inspection/_fetch.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/npe2/_inspection/_fetch.py b/src/npe2/_inspection/_fetch.py index 98e6517b..95a18826 100644 --- a/src/npe2/_inspection/_fetch.py +++ b/src/npe2/_inspection/_fetch.py @@ -41,7 +41,6 @@ "fetch_manifest", "get_pypi_url", "get_hub_plugin", - "get_hub_plugins", "get_pypi_plugins", ] From 84de5698df9aa3c22e853fb78163a77125d4886a Mon Sep 17 00:00:00 2001 From: Nathan Clack Date: Mon, 25 Sep 2023 11:31:42 -0700 Subject: [PATCH 6/6] add version constraint for build --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 508e9c2f..d60bc7e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ classifiers = [ dependencies = [ "PyYAML", "appdirs", - "build", + "build>=1", "psygnal>=0.3.0", "pydantic<2", "tomli-w",