[sdk/python] - Define __all__ for better autocomplete. (#6351)
This commit is contained in:
parent
f4f5aaf500
commit
b6f548a599
|
@ -27,6 +27,9 @@ CHANGELOG
|
|||
- [pkg/testing/integration] Change the default behavior for Python test projects to use `UseAutomaticVirtualEnv` by
|
||||
default. `UsePipenv` can be set to go back to the old behavior of using pipenv with tests.
|
||||
[#6318](https://github.com/pulumi/pulumi/pull/6318)
|
||||
|
||||
- [sdk/python] Define `__all__` in modules for better IDE autocomplete.
|
||||
[#6351](https://github.com/pulumi/pulumi/pull/6351)
|
||||
|
||||
## 2.20.0 (2021-02-03)
|
||||
|
||||
|
|
|
@ -97,3 +97,77 @@ from ._types import (
|
|||
)
|
||||
|
||||
from . import runtime, dynamic, policy, x
|
||||
|
||||
__all__ = [
|
||||
# asset
|
||||
"Asset",
|
||||
"Archive",
|
||||
"AssetArchive",
|
||||
"FileArchive",
|
||||
"FileAsset",
|
||||
"RemoteArchive",
|
||||
"RemoteAsset",
|
||||
"StringAsset",
|
||||
|
||||
# config
|
||||
"Config",
|
||||
"ConfigMissingError",
|
||||
"ConfigTypeError",
|
||||
|
||||
# errors
|
||||
"RunError",
|
||||
|
||||
# invoke
|
||||
"InvokeOptions",
|
||||
|
||||
# metadata
|
||||
"get_project",
|
||||
"get_stack",
|
||||
|
||||
# resource
|
||||
"Alias",
|
||||
"Resource",
|
||||
"CustomResource",
|
||||
"CustomTimeouts",
|
||||
"ComponentResource",
|
||||
"ProviderResource",
|
||||
"ResourceOptions",
|
||||
"create_urn",
|
||||
"export",
|
||||
"ROOT_STACK_RESOURCE",
|
||||
"ResourceTransformation",
|
||||
"ResourceTransformationArgs",
|
||||
"ResourceTransformationResult",
|
||||
|
||||
# output
|
||||
"Output",
|
||||
"Input",
|
||||
"Inputs",
|
||||
"InputType",
|
||||
"UNKNOWN",
|
||||
"contains_unknowns",
|
||||
|
||||
# log
|
||||
"debug",
|
||||
"info",
|
||||
"warn",
|
||||
"error",
|
||||
|
||||
# stack_reference
|
||||
"StackReference",
|
||||
|
||||
# _types
|
||||
"MISSING",
|
||||
"input_type",
|
||||
"output_type",
|
||||
"property",
|
||||
"getter",
|
||||
"get",
|
||||
"set",
|
||||
|
||||
# sub-modules
|
||||
"runtime",
|
||||
"dynamic",
|
||||
"policy",
|
||||
"x"
|
||||
]
|
||||
|
|
|
@ -27,3 +27,14 @@ from .dynamic import (
|
|||
Resource,
|
||||
ResourceProvider,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"CheckResult",
|
||||
"CheckFailure",
|
||||
"DiffResult",
|
||||
"CreateResult",
|
||||
"ReadResult",
|
||||
"UpdateResult",
|
||||
"Resource",
|
||||
"ResourceProvider",
|
||||
]
|
||||
|
|
|
@ -35,11 +35,11 @@ from .settings import (
|
|||
configure,
|
||||
is_dry_run,
|
||||
reset_options,
|
||||
get_root_resource,
|
||||
)
|
||||
|
||||
from .stack import (
|
||||
run_in_stack,
|
||||
get_root_resource,
|
||||
register_stack_transformation,
|
||||
)
|
||||
|
||||
|
@ -57,3 +57,43 @@ from .rpc import (
|
|||
register_resource_module,
|
||||
register_resource_package,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
# config
|
||||
"set_config",
|
||||
"set_all_config",
|
||||
"get_config",
|
||||
"get_config_env",
|
||||
"get_config_env_key",
|
||||
|
||||
# mocks
|
||||
"Mocks",
|
||||
"set_mocks",
|
||||
"test",
|
||||
|
||||
# settings
|
||||
"Settings",
|
||||
"configure",
|
||||
"is_dry_run",
|
||||
"reset_options",
|
||||
"get_root_resource",
|
||||
|
||||
# stack
|
||||
"run_in_stack",
|
||||
"register_stack_transformation",
|
||||
|
||||
# invoke
|
||||
"invoke",
|
||||
|
||||
# _json
|
||||
"to_json",
|
||||
|
||||
# rpc
|
||||
"ResourceModule",
|
||||
"ResourcePackage",
|
||||
"register_resource_module",
|
||||
"register_resource_package",
|
||||
|
||||
# submodules
|
||||
"rpc"
|
||||
]
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
Support for serializing and deserializing properties going into or flowing
|
||||
out of RPC calls.
|
||||
"""
|
||||
import sys
|
||||
import asyncio
|
||||
from collections import abc
|
||||
import functools
|
||||
|
@ -25,7 +24,7 @@ from typing import List, Any, Callable, Dict, Mapping, Optional, Sequence, Set,
|
|||
from enum import Enum
|
||||
|
||||
from google.protobuf import struct_pb2
|
||||
from semver import VersionInfo as Version # type:ignore
|
||||
from semver import VersionInfo as Version # type:ignore
|
||||
import six
|
||||
from . import known_types, settings
|
||||
from .. import log
|
||||
|
|
|
@ -89,7 +89,12 @@ conflicts::
|
|||
|
||||
"""
|
||||
|
||||
from .config import (
|
||||
from ._cmd import (
|
||||
CommandResult,
|
||||
OnOutput
|
||||
)
|
||||
|
||||
from ._config import (
|
||||
ConfigMap,
|
||||
ConfigValue
|
||||
)
|
||||
|
@ -104,7 +109,7 @@ from .errors import (
|
|||
CompilationError
|
||||
)
|
||||
|
||||
from .local_workspace import (
|
||||
from ._local_workspace import (
|
||||
LocalWorkspace,
|
||||
LocalWorkspaceOptions,
|
||||
create_stack,
|
||||
|
@ -112,21 +117,25 @@ from .local_workspace import (
|
|||
create_or_select_stack
|
||||
)
|
||||
|
||||
from .workspace import (
|
||||
from ._workspace import (
|
||||
PluginInfo,
|
||||
StackSummary
|
||||
StackSummary,
|
||||
PulumiFn,
|
||||
Workspace,
|
||||
WhoAmIResult,
|
||||
Deployment,
|
||||
)
|
||||
|
||||
from .project_settings import (
|
||||
from ._project_settings import (
|
||||
ProjectSettings,
|
||||
ProjectRuntimeInfo,
|
||||
)
|
||||
|
||||
from .stack_settings import (
|
||||
from ._stack_settings import (
|
||||
StackSettings
|
||||
)
|
||||
|
||||
from .stack import (
|
||||
from ._stack import (
|
||||
Stack,
|
||||
UpdateSummary,
|
||||
UpResult,
|
||||
|
@ -135,3 +144,56 @@ from .stack import (
|
|||
DestroyResult,
|
||||
fully_qualified_stack_name,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
# _cmd
|
||||
"CommandResult",
|
||||
"OnOutput",
|
||||
|
||||
# config
|
||||
"ConfigMap",
|
||||
"ConfigValue",
|
||||
|
||||
# errors
|
||||
"StackNotFoundError",
|
||||
"StackAlreadyExistsError",
|
||||
"CommandError",
|
||||
"ConcurrentUpdateError",
|
||||
"InlineSourceRuntimeError",
|
||||
"RuntimeError",
|
||||
"CompilationError",
|
||||
|
||||
# local_workspace
|
||||
"LocalWorkspace",
|
||||
"LocalWorkspaceOptions",
|
||||
"create_stack",
|
||||
"select_stack",
|
||||
"create_or_select_stack",
|
||||
|
||||
# workspace
|
||||
"PluginInfo",
|
||||
"StackSummary",
|
||||
"PulumiFn",
|
||||
"Workspace",
|
||||
"Deployment",
|
||||
"WhoAmIResult",
|
||||
|
||||
# project_settings
|
||||
"ProjectSettings",
|
||||
"ProjectRuntimeInfo",
|
||||
|
||||
# stack_settings
|
||||
"StackSettings",
|
||||
|
||||
# stack
|
||||
"Stack",
|
||||
"UpdateSummary",
|
||||
"UpResult",
|
||||
"PreviewResult",
|
||||
"RefreshResult",
|
||||
"DestroyResult",
|
||||
"fully_qualified_stack_name",
|
||||
|
||||
# sub-modules
|
||||
"errors",
|
||||
]
|
||||
|
|
|
@ -19,12 +19,12 @@ import yaml
|
|||
from datetime import datetime
|
||||
from typing import Optional, List, Mapping, Callable
|
||||
|
||||
from .config import ConfigMap, ConfigValue
|
||||
from .project_settings import ProjectSettings
|
||||
from .stack_settings import StackSettings
|
||||
from .workspace import Workspace, PluginInfo, StackSummary, WhoAmIResult, PulumiFn, Deployment
|
||||
from .stack import _DATETIME_FORMAT, Stack
|
||||
from .cmd import _run_pulumi_cmd, CommandResult, OnOutput
|
||||
from ._config import ConfigMap, ConfigValue
|
||||
from ._project_settings import ProjectSettings
|
||||
from ._stack_settings import StackSettings
|
||||
from ._workspace import Workspace, PluginInfo, StackSummary, WhoAmIResult, PulumiFn, Deployment
|
||||
from ._stack import _DATETIME_FORMAT, Stack
|
||||
from ._cmd import _run_pulumi_cmd, CommandResult, OnOutput
|
||||
|
||||
_setting_extensions = [".yaml", ".yml", ".json"]
|
||||
|
|
@ -18,7 +18,7 @@ import sys
|
|||
import traceback
|
||||
from contextlib import suppress
|
||||
|
||||
from .workspace import PulumiFn
|
||||
from ._workspace import PulumiFn
|
||||
from ... import log
|
||||
from ...runtime.proto import language_pb2, plugin_pb2, LanguageRuntimeServicer
|
||||
from ...runtime import run_in_stack, reset_options, set_all_config
|
||||
|
|
|
@ -19,11 +19,11 @@ from enum import Enum
|
|||
from datetime import datetime
|
||||
from typing import List, Any, Mapping, MutableMapping, Optional
|
||||
|
||||
from .cmd import CommandResult, _run_pulumi_cmd, OnOutput
|
||||
from .config import ConfigValue, ConfigMap, _SECRET_SENTINEL
|
||||
from ._cmd import CommandResult, _run_pulumi_cmd, OnOutput
|
||||
from ._config import ConfigValue, ConfigMap, _SECRET_SENTINEL
|
||||
from .errors import StackAlreadyExistsError
|
||||
from ._server import LanguageServer
|
||||
from .workspace import Workspace, PulumiFn, Deployment
|
||||
from ._workspace import Workspace, PulumiFn, Deployment
|
||||
from ...runtime.settings import _GRPC_CHANNEL_OPTIONS
|
||||
from ...runtime.proto import language_pb2_grpc
|
||||
|
|
@ -22,9 +22,9 @@ from typing import (
|
|||
Optional
|
||||
)
|
||||
|
||||
from .stack_settings import StackSettings
|
||||
from .project_settings import ProjectSettings
|
||||
from .config import ConfigMap, ConfigValue
|
||||
from ._stack_settings import StackSettings
|
||||
from ._project_settings import ProjectSettings
|
||||
from ._config import ConfigMap, ConfigValue
|
||||
|
||||
PulumiFn = Callable[[], None]
|
||||
|
|
@ -16,7 +16,7 @@ import re
|
|||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .cmd import CommandResult
|
||||
from ._cmd import CommandResult
|
||||
|
||||
|
||||
class CommandError(Exception):
|
||||
|
|
Loading…
Reference in a new issue