pulumi/sdk/python/lib/pulumi
Pat Gavlin 248f78bafe [sdk/*] Add support for resource source positions
Add support to the core SDKs for reporting resource source positions.

In each SDK, this is implemented by crawling the stack when a resource
is registered in order to determine the position of the user code that
registered the resource.

This is somewhat brittle in that it expects a call stack of the form:
- Resource class constructor
- abstract Resource subclass constructor
- concrete Resource subclass constructor
- user code

This stack reflects the expected class hierarchy of "cloud resource /
component resource < customresource/componentresource < resource".

For example, consider the AWS S3 Bucket resource. When user code
instantiates a Bucket, the stack will look like
this in NodeJS:

    new Resource (/path/to/resource.ts:123:45)
    new CustomResource (/path/to/resource.ts:678:90)
    new Bucket (/path/to/bucket.ts:987:65)
    <user code> (/path/to/index.ts:4:3)

In order to determine the source position, we locate the fourth frame
(the `<user code>` frame).
2023-07-13 16:46:04 -07:00
..
automation Make pythons RPCManager a context variable 2023-07-13 09:59:12 +01:00
dynamic Always mark dynamic provider code as secret 2023-07-06 13:50:59 +01:00
policy Make getOrganization total, default to 'organization' 2022-09-22 11:06:51 -07:00
provider Fix protobuf checksum code and regenerate 2022-11-04 09:57:05 +00:00
runtime [sdk/*] Add support for resource source positions 2023-07-13 16:46:04 -07:00
__init__.py sdk/py/StackReference: Add get_output_details 2023-02-03 16:58:35 -08:00
_types.py Fix protobuf checksum code and regenerate 2022-11-04 09:57:05 +00:00
_utils.py fix(sdk/python): Makes SETTINGS attributes context-aware (#10402) 2022-08-23 13:45:37 -04:00
asset.py Reformat python 2023-02-01 09:45:06 +00:00
config.py Add --secret to config set hints when needed 2023-06-22 17:25:30 +01:00
errors.py Python Dynamic Providers (#2900) 2019-07-19 10:18:25 -07:00
invoke.py [codegen/python] Implement deep merge on resource and invoke options, matching other SDKs (#9856) 2022-06-14 16:52:24 -07:00
log.py Use black code formatter for the python sdk (#8919) 2022-02-04 01:16:16 +01:00
metadata.py Make getOrganization total, default to 'organization' 2022-09-22 11:06:51 -07:00
output.py Fix links outputs docs 2023-07-12 14:59:07 -07:00
py.typed Add py.typed to Python package for PEP 561 compliance (#3704) 2020-01-17 15:01:36 -08:00
resource.py [sdk/python] Support explicit providers for packaged components 2023-07-13 07:17:37 -07:00
stack_reference.py sdk/py/StackReference: Add get_output_details 2023-02-03 16:58:35 -08:00
urn.py Use black code formatter for the python sdk (#8919) 2022-02-04 01:16:16 +01:00