pulumi/sdk
Justin Van Patten 4f2373cafd
Python: Fix determining plugins for old packages (#15576)
The Python language host determines which Pulumi plugins are required by
the program by calling out to `python -m pip list -v -format json` to
get the list of installed packages. If a package contains a
`pulumi-plugin.json` file that indicates it is for a resource plugin,
then that package is considered a Pulumi package that has an associated
plugin.

As a fallback for older packages that do not have a `pulumi-plugin.json`
file, if the package name is prefixed with `pulumi-`, it is also
considered to have an associated Pulumi plugin.

However, this fallback no longer works when using recent versions of
setuptools because of a behavior change in v69.0.3 and later of
setuptools. Previously, underscores were replaced by dashes. So `python
-m pip list --format json` would return the name of the package as:

```
{"name": "pulumi-cloudinit", "version": "1.3.0"}
```

But now with setuptools v69.0.3 and later, it returns the name as
pulumi_cloudinit (with an underscore rather than dash):

```
{"name": "pulumi_cloudinit", "version": "1.3.0"}
```

The underscore in the name is now preserved and the name is no longer
prefixed with pulumi-, so the langhost no longer considers it to have an
associated Pulumi plugin.

This commit fixes the fallback to consider packages prefixed by either
`pulumi_` or `pulumi-` to be Pulumi packages.

Fixes #15536
2024-03-04 07:23:34 +00:00
..
go Changelog and go.mod updates for v3.108.1 (#15571) 2024-03-01 22:33:54 +00:00
nodejs Cleanup so uses of `any` in the nodejs sdk (#15558) 2024-03-02 00:00:57 +00:00
proto/go Engine support for remote transforms (#15290) 2024-02-21 16:30:46 +00:00
python Python: Fix determining plugins for old packages (#15576) 2024-03-04 07:23:34 +00:00
.version Freeze v3.108.1 (#15563) 2024-03-01 19:55:08 +00:00
README.md Cleanup sdk/README.md 2023-01-03 17:12:12 -05:00
go.mod Go SDK transform support (#15355) 2024-02-27 13:00:45 +00:00
go.sum Go SDK transform support (#15355) 2024-02-27 13:00:45 +00:00
version.go Move .version to /sdk and embed it (#15185) 2024-01-19 14:11:17 +00:00

README.md

Pulumi Language SDKs

This directory contains Pulumi SDKs for the following languages:

See the respective READMEs for information about installing and using these libraries.

The language providers work by implementing gRPC interfaces defined in the top level directory proto.