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

Set range in python codegen default SDK version #16151

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

danielrbradley
Copy link
Member

@danielrbradley danielrbradley commented May 8, 2024

Description

If the schema doesn't set any specific dependencies, we should be defaulting to requiring pulumi within the current major version rather than completely unconstrained.

Discussion: https://github.com/pulumi/pulumi-kafka/pull/410/files#r1594324390

Checklist

  • I have run make tidy to update any new dependencies
  • I have run make lint to verify my code passes the lint check
    • I have formatted my code using gofumpt
  • I have added tests that prove my fix is effective or that my feature works
  • I have run make changelog and committed the changelog/pending/<file> documenting my change
  • Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version

If the schema doesn't set any specific dependencies, we should be defaulting to requiring pulumi within the current major version rather than completely unconstrained.

Discussion: https://github.com/pulumi/pulumi-kafka/pull/410/files#r1594324390
@pulumi-bot
Copy link
Contributor

pulumi-bot commented May 8, 2024

Changelog

[uncommitted] (2024-05-09)

@danielrbradley danielrbradley added the impact/no-changelog-required This issue doesn't require a CHANGELOG update label May 8, 2024
Copy link
Member

@Frassle Frassle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reasonable. Probably need to regenerate snapshots with PULUMI_ACCEPT

Copy link
Collaborator

@tgummerer tgummerer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment here gives me pause, but even looking at the history it doesn't make a lot of sense here. (This seems to have been introduced in 8b98abd) I think my preference would be to just remove this shortcircuiting completely, since it seems unnecessary, and it can more easily fall out of sync with the code below.

Curious if other folks more familiar with codegen have opinions on this though.

Copy link
Member

@justinvp justinvp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable as it matches what we do in other SDKs. Not sure there's any benefit to ever emitting the dependency without a version constraint.

As @Frassle points out, this will need to regenerate snapshots with PULUMI_ACCEPT.

pkg/codegen/python/gen.go Outdated Show resolved Hide resolved
pkg/codegen/python/gen.go Outdated Show resolved Hide resolved
- Extract default SDK range to a const.
- Update comments to reflect reality.
danielrbradley added a commit to pulumi/pulumi-kafka that referenced this pull request May 9, 2024
- We want to depend on the curret major version for python. This is being fixed in codegen here: pulumi/pulumi#16151
- The default dotnet range resolves to minimum version rather than the latest version which could be problematic.
@Frassle
Copy link
Member

Frassle commented May 9, 2024

Pull Request / CI / Unit Test / sdk/python/cmd/pulumi-language-python

tests in this folder need running with PULUMI_ACCEPT as well because they also generate SDKs.

@danielrbradley
Copy link
Member Author

danielrbradley commented May 9, 2024

Pull Request / CI / Unit Test / sdk/python/cmd/pulumi-language-python

tests in this folder need running with PULUMI_ACCEPT as well because they also generate SDKs.

Currently unable to run these locally ... running:

PULUMI_ACCEPT=true go test -timeout 1h -tags all -run ^TestLanguage$ github.com/pulumi/pulumi/sdk/python/cmd/pulumi-language-python/v3
pulumi/sdk/python/cmd/pulumi-language-python/language_test.go:118: build output:
error: externally-managed-environment
...

Not sure if there's a pre-requisite step I've missed here? I ran make build in sdk/python/ first.

Fails with the same error when running make test_all in sdk/python too - which doesn't match the error in CI, so I'm sure I'm doing something wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/no-changelog-required This issue doesn't require a CHANGELOG update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants