diff --git a/sdk/python/lib/pulumi_policy/pulumiplugin.json b/sdk/python/lib/pulumi_policy/pulumi-plugin.json similarity index 100% rename from sdk/python/lib/pulumi_policy/pulumiplugin.json rename to sdk/python/lib/pulumi_policy/pulumi-plugin.json diff --git a/sdk/python/lib/setup.py b/sdk/python/lib/setup.py index 79d4d23..a84e464 100644 --- a/sdk/python/lib/setup.py +++ b/sdk/python/lib/setup.py @@ -36,7 +36,7 @@ def readme(): package_data={ 'pulumi_policy': [ 'py.typed', - 'pulumiplugin.json' + 'pulumi-plugin.json' ] }, install_requires=[ diff --git a/tests/integration/integration_test.go b/tests/integration/integration_test.go index 7181eea..2ceb682 100644 --- a/tests/integration/integration_test.go +++ b/tests/integration/integration_test.go @@ -26,6 +26,7 @@ import ( ptesting "github.com/pulumi/pulumi/sdk/v3/go/common/testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) type Runtime int @@ -869,3 +870,30 @@ func TestRemoteComponent(t *testing.T) { }, }) } + +func TestPythonDoesNotTryToInstallPlugin(t *testing.T) { + e := ptesting.NewEnvironment(t) + t.Log(e.RootPath) + defer e.DeleteIfNotFailed() + + pulumiHome := t.TempDir() + t.Setenv("PULUMI_HOME", pulumiHome) + + e.RunCommand("pulumi", "login", "--local") + e.RunCommand("pulumi", "new", "python", "--generate-only", "--yes", "--force") + + requirementsTxtPath := filepath.Join(e.RootPath, "requirements.txt") + + dep, err := filepath.Abs(filepath.Join("..", "..", "sdk", "python", "lib")) + require.NoError(t, err) + + file, err := os.OpenFile(requirementsTxtPath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644) + require.NoError(t, err) + defer file.Close() + _, err = file.WriteString(dep) + require.NoError(t, err) + + // Pulumi should not try to install a plugin for pulumi_policy. + // This command will fail if it tries to install the non-existent pulumi_policy plugin. + e.RunCommand("pulumi", "install") +}