Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indicate the PyPi package doesn't have a plugin #358

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

---

## Unreleased

- Python: Indicate that the PyPi package doesn't have an associated Pulumi plugin
(https://github.com/pulumi/pulumi-policy/pull/358).

## 1.11.0 (2024-04-17)

- Fix panic when a stack policy with a "remediate" level reports a violation
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/lib/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def readme():
package_data={
'pulumi_policy': [
'py.typed',
'pulumiplugin.json'
'pulumi-plugin.json'
]
},
install_requires=[
Expand Down
28 changes: 28 additions & 0 deletions tests/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
}
Loading