Skip to content

Commit

Permalink
Merge #11431 #11437
Browse files Browse the repository at this point in the history
11431: Bumps grpcio to version 1.50 r=kpitzen a=kpitzen

Currently, pinning to a version of grpcio <1.50 can cause build errors on newer versions of python+pip - the existing setup.py install method of building libararies is being deprecated and wheels are not being backported for older versions of grpcio.  Since this change is a no-op as far as our python proto clients are concerned, it feels safe to bump to a version that will be supported going forward

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

Fixes #11276 

Though this change doesn't result in guaranteed Python 3.11 support, it should allow users of Python 3.11 to at least install Pulumi successfully without Deprecation warnings etc.  grpcio 1.4X does not ship 3.11-compatible wheels, so users are starting to see errors when installing Pulumi - bumping to this version also does not change our existing proto clients in Python, so feels like a relatively safe change.

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [ ] I have added tests that prove my fix is effective or that my feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Service,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


11437: Mark external modules as forign r=iwahbe a=iwahbe

Fixes #8070

Progress on #11427

Co-authored-by: Kyle Pitzen <kyle.pitzen@gmail.com>
Co-authored-by: Ian Wahbe <ian@wahbe.com>
  • Loading branch information
3 people committed Nov 22, 2022
3 parents 6c046a9 + bac8315 + 724fae5 commit d4eb1a3
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 16 deletions.
@@ -0,0 +1,4 @@
changes:
- type: chore
scope: sdk/python
description: Bumps grpcio to 1.50
11 changes: 7 additions & 4 deletions pkg/codegen/go/gen.go
Expand Up @@ -40,6 +40,11 @@ import (
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
)

// A signifier that the module is external, and will never match.
//
// This token is always an invalid module since ':' is not allowed within modules.
const ExternalModuleSig = ":always-external:"

type typeDetails struct {
// Note: if any of {ptr,array,map}Input are set, input and the corresponding output field must also be set. The
// mark* functions ensure that these invariants hold.
Expand Down Expand Up @@ -242,10 +247,7 @@ func (pkg *pkgContext) resolveEnumType(t *schema.EnumType) string {
}

extPkgCtx, _ := pkg.contextForExternalReference(t)
enumType := extPkgCtx.tokenToEnum(t.Token)
if !strings.Contains(enumType, ".") {
enumType = fmt.Sprintf("%s.%s", extPkgCtx.pkg.Name, enumType)
}
enumType := extPkgCtx.typeString(t)
return enumType
}

Expand Down Expand Up @@ -730,6 +732,7 @@ func (pkg *pkgContext) contextForExternalReference(t schema.Type) (*pkgContext,
extPkgCtx.pkgImportAliases = pkgImportAliases
extPkgCtx.externalPackages = pkg.externalPackages
mod := tokenToPackage(extPkg, goInfo.ModuleToPackage, token)
extPkgCtx.mod = ExternalModuleSig

return extPkgCtx, *maps[mod].detailsForType(t)
}
Expand Down
6 changes: 4 additions & 2 deletions pkg/codegen/go/gen_program_expressions.go
Expand Up @@ -168,8 +168,10 @@ func (g *generator) genSafeEnum(w io.Writer, to *model.EnumType) func(member *sc
}
memberTag, err := makeSafeEnumName(memberTag, enumName)
contract.AssertNoErrorf(err, "Enum is invalid")
namespace := tokenToModule(to.Token)
g.Fgenf(w, "%s.%s", namespace, memberTag)
pkg, mod, _, _ := pcl.DecomposeToken(to.Token, to.SyntaxNode().Range())
mod = g.getModOrAlias(pkg, mod, mod)

g.Fgenf(w, "%s.%s", mod, memberTag)
}
}

Expand Down
2 changes: 0 additions & 2 deletions pkg/codegen/testing/test/program_driver.go
Expand Up @@ -113,8 +113,6 @@ var PulumiPulumiProgramTests = []ProgramTest{
{
Directory: "aws-webserver",
Description: "AWS Webserver",
SkipCompile: codegen.NewStringSet("go"),
// Blocked on go: TODO[pulumi/pulumi#8070]
},
{
Directory: "simple-range",
Expand Down
Expand Up @@ -25,9 +25,9 @@ func main() {
if err != nil {
return err
}
ami, err := aws.GetAmi(ctx, &GetAmiArgs{
Filters: []GetAmiFilter{
GetAmiFilter{
ami, err := aws.GetAmi(ctx, &aws.GetAmiArgs{
Filters: []aws.GetAmiFilter{
aws.GetAmiFilter{
Name: "name",
Values: []string{
"amzn-ami-hvm-*-x86_64-ebs",
Expand Down
2 changes: 1 addition & 1 deletion proto/.checksum.txt
@@ -1,4 +1,4 @@
283055245 2069 proto/build-container/Dockerfile
3850377987 2069 proto/build-container/Dockerfile
3003861496 625 proto/build-container/scripts/install-go.sh
853251015 873 proto/build-container/scripts/install-node.sh
2003827277 549 proto/build-container/scripts/install-packages.sh
Expand Down
4 changes: 2 additions & 2 deletions proto/build-container/Dockerfile
Expand Up @@ -54,6 +54,6 @@ RUN PROTOC_VERSION=3.20.1 \
PROTOC_GEN_GO_VERSION=1.5.2 \
NODEJS_GRPC_VERSION=1.24.2 \
NODEJS_GRPC_TOOLS_VERSION=1.8.1 \
PYTHON_GRPCIO_VERSION=1.49.1 \
PYTHON_GRPCIO_TOOLS_VERSION=1.49.1 \
PYTHON_GRPCIO_VERSION=1.50.0 \
PYTHON_GRPCIO_TOOLS_VERSION=1.50.0 \
/build-scripts/install-protobuf-tools.sh
2 changes: 1 addition & 1 deletion sdk/python/lib/setup.py
Expand Up @@ -45,7 +45,7 @@ def readme():
# Keep this list in sync with Pipfile
install_requires=[
'protobuf~=4.21',
'grpcio==1.47',
'grpcio==1.50',
'dill~=0.3',
'six~=1.12',
'semver~=2.8',
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/requirements.txt
@@ -1,7 +1,7 @@
# Packages needed by the library.
# Keep this list in sync with setup.py.
protobuf~=4.21
grpcio==1.47
grpcio==1.50
dill~=0.3
six~=1.12
semver~=2.8
Expand Down

0 comments on commit d4eb1a3

Please sign in to comment.