diff --git a/src/ape/plugins/__init__.py b/src/ape/plugins/__init__.py index 549fe0d7e5..9a20e27741 100644 --- a/src/ape/plugins/__init__.py +++ b/src/ape/plugins/__init__.py @@ -169,9 +169,7 @@ def registered_plugins(self) -> Set[str]: @functools.cached_property def _plugin_modules(self) -> Tuple[str, ...]: - core_plugin_module_names = { - n for _, n, _ in pkgutil.iter_modules() if n.startswith("ape_") - } + core_plugin_module_names = {n for _, n, _ in pkgutil.iter_modules() if n.startswith("ape_")} if PIP_COMMAND[0] != "uv": # NOTE: Unable to use pkgutil.iter_modules() for installed plugins # because it does not work with editable installs. @@ -188,8 +186,8 @@ def _plugin_modules(self) -> Tuple[str, ...]: # format is in the output of: # Package Version Editable project location # ------------------------- ------------------------------- ------------------------- - # aiosignal 1.3.1 - # annotated-types 0.6.0 + # aiosignal 1.3.1 + # annotated-types 0.6.0 # skip the header packages = result.decode("utf8").splitlines()[2:] installed_plugin_module_names = { diff --git a/src/ape_plugins/_cli.py b/src/ape_plugins/_cli.py index 84da1ba9c6..5cb96807a1 100644 --- a/src/ape_plugins/_cli.py +++ b/src/ape_plugins/_cli.py @@ -226,10 +226,11 @@ def change_version(version): _change_version(version) + def _install(name, spec) -> int: """ Helper function to install or update a Python package using pip. - + Args: name (str): The package name. spec (str): Version specifier, e.g., '==1.0.0', '>=1.0.0', etc. @@ -241,7 +242,7 @@ def _install(name, spec) -> int: args, capture_output=True, text=True, # Output as string - check=False # Allow manual error handling + check=False, # Allow manual error handling ) # Check for installation errors @@ -256,6 +257,7 @@ def _install(name, spec) -> int: return completed_process.returncode + def _change_version(spec: str): # Update all the plugins. # This will also update core Ape.