import click from meltano.core.plugin import PluginType from meltano.core.project_add_service import ProjectAddService from meltano.core.project_plugins_service import ProjectPluginsService from meltano.core.tracking import GoogleAnalyticsTracker from . import cli from .params import pass_project from .utils import CliError, add_related_plugins, install_plugins @cli.command() @click.argument( "plugin_type", type=click.Choice(PluginType.cli_arguments()), required=False ) @click.argument("plugin_name", nargs=-1, required=False) @click.option("--include-related", is_flag=True) @pass_project(migrate=True) def install(project, plugin_type, plugin_name, include_related): """ Installs all the dependencies of your project based on the meltano.yml file. Read more at https://www.meltano.com/docs/command-line-interface.html. """ plugins_service = ProjectPluginsService(project) if plugin_type: plugin_type = PluginType.from_cli_argument(plugin_type) plugins = plugins_service.get_plugins_of_type(plugin_type) if plugin_name: plugins = [p for p in plugins if p.name in plugin_name] else:
from .params import project from meltano.core.db import project_engine from meltano.core.project import Project from meltano.core.plugin import PluginType from meltano.core.config_service import ConfigService from meltano.core.plugin.settings_service import ( PluginSettingsService, SettingValueSource, SettingValueStore, ) @cli.group(invoke_without_command=True) @click.option("--plugin-type", type=click.Choice(PluginType.cli_arguments()), default=None) @click.argument("plugin_name") @click.option("--format", type=click.Choice(["json", "env"]), default="json") @project(migrate=True) @click.pass_context def config(ctx, project, plugin_type, plugin_name, format): plugin_type = PluginType.from_cli_argument( plugin_type) if plugin_type else None config = ConfigService(project) plugin = config.find_plugin(plugin_name, plugin_type=plugin_type, configurable=True) _, Session = project_engine(project)
from urllib.parse import urlparse import click import yaml from meltano.core.plugin import PluginType from meltano.core.plugin_install_service import PluginInstallReason from meltano.core.project_add_service import ProjectAddService from meltano.core.project_plugins_service import ProjectPluginsService from . import cli from .params import pass_project from .utils import CliError, add_plugin, add_related_plugins, install_plugins @cli.command() @click.argument("plugin_type", type=click.Choice(PluginType.cli_arguments())) @click.argument("plugin_name", nargs=-1, required=True) @click.option("--inherit-from") @click.option("--variant") @click.option("--as", "as_name") @click.option("--custom", is_flag=True) @click.option("--include-related", is_flag=True) @pass_project() @click.pass_context def add( ctx, project, plugin_type, plugin_name, inherit_from=None, variant=None,