Skip to content

Commit

Permalink
style: [pre-commit.ci] auto fixes [...]
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 6, 2025
1 parent 944463a commit 49294ea
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 31 deletions.
10 changes: 5 additions & 5 deletions src/npe2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
from .manifest import PackageMetadata, PluginManifest

__all__ = [
"__version__",
"DynamicPlugin",
"fetch_manifest",
"get_manifest_from_wheel",
"PackageMetadata",
"PluginContext",
"PluginManager",
"PluginManifest",
"read_get_reader",
"__version__",
"fetch_manifest",
"get_manifest_from_wheel",
"read",
"write_get_writer",
"read_get_reader",
"write",
"write_get_writer",
]
4 changes: 2 additions & 2 deletions src/npe2/_inspection/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

__all__ = [
"NPE2PluginModuleVisitor",
"find_npe2_module_contributions",
"find_npe1_module_contributions",
"compile",
"find_npe1_module_contributions",
"find_npe2_module_contributions",
]
2 changes: 1 addition & 1 deletion src/npe2/_inspection/_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
NPE2_ENTRY_POINT = "napari.manifest"
__all__ = [
"fetch_manifest",
"get_pypi_url",
"get_hub_plugin",
"get_pypi_plugins",
"get_pypi_url",
]


Expand Down
16 changes: 8 additions & 8 deletions src/npe2/_plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ def __init__(
else: # pragma: no cover
vsplit = nv.split(".")[:4]
if (
"dev" in nv
and vsplit < ["0", "4", "16", "dev4"]
or "dev" not in nv
and vsplit < ["0", "4", "16"]
("dev" in nv
and vsplit < ["0", "4", "16", "dev4"])
or ("dev" not in nv
and vsplit < ["0", "4", "16"])
):
self.discover()

Expand Down Expand Up @@ -699,11 +699,11 @@ def get_writer(
for writer in self.iter_compatible_writers(layer_types):
if not plugin_name or writer.command.startswith(plugin_name):
if (
ext
and ext in writer.filename_extensions
or not ext
(ext
and ext in writer.filename_extensions)
or (not ext
and len(layer_types) != 1
and not writer.filename_extensions
and not writer.filename_extensions)
):
return writer, path
elif not ext and len(layer_types) == 1: # No extension, single layer.
Expand Down
14 changes: 7 additions & 7 deletions src/npe2/_pydantic_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@


__all__ = (
"SHAPE_LIST",
"BaseModel",
"ErrorWrapper",
"Extra",
"Field",
"ValidationError",
"root_validator",
"validator",
"GenericModel",
"ModelMetaclass",
"PrivateAttr",
"ValidationError",
"color",
"conlist",
"constr",
"ModelMetaclass",
"ErrorWrapper",
"GenericModel",
"SHAPE_LIST",
"root_validator",
"validator",
)
2 changes: 1 addition & 1 deletion src/npe2/implements.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def writer(
id: str,
title: str,
layer_types: list[str],
filename_extensions: list[str] = [], # noqa: B006
filename_extensions: list[str] = [],
display_name: str = "",
ensure_args_valid: bool = False,
) -> Callable[[T], T]:
Expand Down
2 changes: 1 addition & 1 deletion src/npe2/manifest/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ._package_metadata import PackageMetadata
from .schema import ENTRY_POINT, PluginManifest

__all__ = ["PackageMetadata", "PluginManifest", "ENTRY_POINT"]
__all__ = ["ENTRY_POINT", "PackageMetadata", "PluginManifest"]
6 changes: 3 additions & 3 deletions src/npe2/manifest/contributions/_contributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
from ._writers import WriterContribution

__all__ = [
"ContributionPoints",
"CommandContribution",
"ContributionPoints",
"KeyBindingContribution",
"MenuItem",
"ReaderContribution",
"SampleDataContribution",
"SampleDataGenerator",
"SampleDataURI",
"SubmenuContribution",
"ThemeContribution",
"WidgetContribution",
"WriterContribution",
"SampleDataGenerator",
"SampleDataURI",
]


Expand Down
6 changes: 3 additions & 3 deletions src/npe2/manifest/contributions/_json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
ValidationError = Exception

__all__ = [
"ValidationError",
"Draft04JsonSchema",
"Draft06JsonSchema",
"Draft07JsonSchema",
"ValidationError",
]

JsonType = Literal["array", "boolean", "integer", "null", "number", "object", "string"]
Expand Down Expand Up @@ -171,11 +171,11 @@ def is_object(self) -> bool:
"""Return True if this schema is an object schema."""
return (
self.properties is not None
or self.type == "object"
or (self.type == "object"
and not self.all_of
and not self.one_of
and not self.any_of
and not getattr(self, "ref", False) # draft 6+
and not getattr(self, "ref", False)) # draft 6+
)

@property
Expand Down

0 comments on commit 49294ea

Please sign in to comment.