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

update url for fetching plugin listing from napari hub #313

Merged
merged 6 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ classifiers = [
dependencies = [
"PyYAML",
"appdirs",
"build",
"build>=1",
"psygnal>=0.3.0",
"pydantic<2",
"tomli-w",
Expand Down
8 changes: 0 additions & 8 deletions src/npe2/_inspection/_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"fetch_manifest",
"get_pypi_url",
"get_hub_plugin",
"get_hub_plugins",
"get_pypi_plugins",
]

Expand Down Expand Up @@ -405,13 +404,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") 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."""
Expand Down
4 changes: 2 additions & 2 deletions src/npe2/_inspection/_full_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
nclack marked this conversation as resolved.
Show resolved Hide resolved

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")
Expand Down
6 changes: 0 additions & 6 deletions tests/test_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -93,11 +92,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"
Expand Down