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