diff --git a/Makefile b/Makefile index 09605e95ab844..145079ed7587e 100644 --- a/Makefile +++ b/Makefile @@ -70,8 +70,8 @@ install-s3: venv ## Install dependencies for the localstack runtime for s3-o install: install-dev entrypoints ## Install full dependencies into venv -entrypoints: ## Run setup.py develop to build entry points - $(VENV_RUN); python setup.py plugins egg_info +entrypoints: ## Run plux to build entry points + $(VENV_RUN); python -m plux entrypoints @# make sure that the entrypoints were correctly created and are non-empty @test -s localstack_core.egg-info/entry_points.txt || (echo "Entrypoints were not correctly created! Aborting!" && exit 1) diff --git a/localstack/cli/plugin.py b/localstack/cli/plugin.py index eb9c425f71965..f9af88474a6d5 100644 --- a/localstack/cli/plugin.py +++ b/localstack/cli/plugin.py @@ -3,7 +3,7 @@ import os import click -from plugin import Plugin, PluginManager +from plux import Plugin, PluginManager LOG = logging.getLogger(__name__) diff --git a/localstack/cli/plugins.py b/localstack/cli/plugins.py index aa81bca7ec8e9..c63588161d304 100644 --- a/localstack/cli/plugins.py +++ b/localstack/cli/plugins.py @@ -2,8 +2,9 @@ import time import click -from plugin import PluginManager -from plugin.entrypoint import find_plugins, spec_to_entry_point +from plux import PluginManager +from plux.build.setuptools import find_plugins +from plux.core.entrypoint import spec_to_entry_point from rich import print as rprint from rich.console import Console from rich.table import Table diff --git a/localstack/extensions/api/extension.py b/localstack/extensions/api/extension.py index 96e7c40f74b6c..080735c4ae3a3 100644 --- a/localstack/extensions/api/extension.py +++ b/localstack/extensions/api/extension.py @@ -1,4 +1,4 @@ -from plugin import Plugin +from plux import Plugin from .aws import CompositeExceptionHandler, CompositeHandler, CompositeResponseHandler from .http import RouteHandler, Router diff --git a/localstack/packages/api.py b/localstack/packages/api.py index 53b51166dc568..26df1942f5bac 100644 --- a/localstack/packages/api.py +++ b/localstack/packages/api.py @@ -8,7 +8,7 @@ from threading import RLock from typing import Callable, List, Optional, Tuple -from plugin import Plugin, PluginManager, PluginSpec +from plux import Plugin, PluginManager, PluginSpec from localstack import config diff --git a/localstack/runtime/hooks.py b/localstack/runtime/hooks.py index 749673e2ee698..9b5a8b575bb04 100644 --- a/localstack/runtime/hooks.py +++ b/localstack/runtime/hooks.py @@ -1,6 +1,6 @@ import functools -from plugin import PluginManager, plugin +from plux import PluginManager, plugin # plugin namespace constants HOOKS_CONFIGURE_LOCALSTACK_CONTAINER = "localstack.hooks.configure_localstack_container" diff --git a/localstack/services/cloudformation/resource_provider.py b/localstack/services/cloudformation/resource_provider.py index d2d83876db5b1..c75993d175f25 100644 --- a/localstack/services/cloudformation/resource_provider.py +++ b/localstack/services/cloudformation/resource_provider.py @@ -12,7 +12,7 @@ import botocore from botocore.exceptions import UnknownServiceError -from plugin import Plugin, PluginManager +from plux import Plugin, PluginManager from localstack import config from localstack.aws.connect import ServiceLevelClientFactory, connect_to diff --git a/localstack/services/internal.py b/localstack/services/internal.py index 91f71c8acb904..010c5b35a2ddb 100644 --- a/localstack/services/internal.py +++ b/localstack/services/internal.py @@ -219,7 +219,7 @@ class PluginsResource: """ def on_get(self, request): - from plugin import PluginManager + from plux import PluginManager from localstack.runtime import hooks from localstack.services.plugins import SERVICE_PLUGINS diff --git a/localstack/services/lambda_/invocation/plugins.py b/localstack/services/lambda_/invocation/plugins.py index 396974f8697ae..0941b4118a957 100644 --- a/localstack/services/lambda_/invocation/plugins.py +++ b/localstack/services/lambda_/invocation/plugins.py @@ -1,4 +1,4 @@ -from plugin import Plugin +from plux import Plugin class RuntimeExecutorPlugin(Plugin): diff --git a/localstack/services/lambda_/invocation/runtime_executor.py b/localstack/services/lambda_/invocation/runtime_executor.py index 91d9f85cbdb8b..d8fb5c85b1c5d 100644 --- a/localstack/services/lambda_/invocation/runtime_executor.py +++ b/localstack/services/lambda_/invocation/runtime_executor.py @@ -4,7 +4,7 @@ from pathlib import Path from typing import Type -from plugin import PluginManager +from plux import PluginManager from localstack import config from localstack.services.lambda_.invocation.lambda_models import FunctionVersion, InvocationResult diff --git a/localstack/services/plugins.py b/localstack/services/plugins.py index eebdb6ef8b6f8..8b6a9d5315b6c 100644 --- a/localstack/services/plugins.py +++ b/localstack/services/plugins.py @@ -7,7 +7,7 @@ from enum import Enum from typing import Callable, Dict, List, Optional, Protocol, Tuple -from plugin import Plugin, PluginLifecycleListener, PluginManager, PluginSpec +from plux import Plugin, PluginLifecycleListener, PluginManager, PluginSpec from localstack import config from localstack.aws.skeleton import DispatchTable, Skeleton diff --git a/localstack/state/snapshot.py b/localstack/state/snapshot.py index a3e7155f8ef9e..9f936fb280dda 100644 --- a/localstack/state/snapshot.py +++ b/localstack/state/snapshot.py @@ -1,4 +1,4 @@ -from plugin import Plugin +from plux import Plugin from .core import StateVisitor diff --git a/localstack/utils/bootstrap.py b/localstack/utils/bootstrap.py index 3fb365e4b1f73..25ceb446a7d9c 100644 --- a/localstack/utils/bootstrap.py +++ b/localstack/utils/bootstrap.py @@ -1116,7 +1116,7 @@ def configure_container(container: Container): else: container.config.additional_flags = f"{container.config.additional_flags} {user_flags}" - # get additional parameters from plugins + # get additional parameters from plux hooks.configure_localstack_container.run(container) if config.DEVELOP: diff --git a/pyproject.toml b/pyproject.toml index f36e89d419468..e7f6425ff1d26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ # LocalStack project configuration [build-system] -requires = ['setuptools', 'wheel', 'plux>=1.3.1'] +requires = ['setuptools', 'wheel', 'plux>=1.7'] build-backend = "setuptools.build_meta" [tool.black] diff --git a/setup.cfg b/setup.cfg index 8291371a786f5..263e3b57d6c58 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,7 +31,7 @@ install_requires = dill==0.3.6 dnslib>=0.9.10 dnspython>=1.16.0 - plux>=1.3.1 + plux>=1.7 psutil>=5.4.8 python-dotenv>=0.19.1 pyyaml>=5.1