Skip to content

Commit

Permalink
lint with black
Browse files Browse the repository at this point in the history
  • Loading branch information
wakamex committed Apr 15, 2024
1 parent e0a23df commit e16e99e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/ape/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 = {
Expand Down
6 changes: 4 additions & 2 deletions src/ape_plugins/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit e16e99e

Please sign in to comment.