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

2.0.0b4 no longer works, possibly due to grpcio/grpcio-tools update #341

Closed
pigfrown opened this issue Feb 18, 2022 · 10 comments
Closed

2.0.0b4 no longer works, possibly due to grpcio/grpcio-tools update #341

pigfrown opened this issue Feb 18, 2022 · 10 comments
Labels
compiler-bug The compiler is broken

Comments

@pigfrown
Copy link

pigfrown commented Feb 18, 2022

Using example from README:

syntax = "proto3";

package hello;

// Greeting represents a message you can tell a user.
message Greeting {
  string message = 1;
}

Setup virtualenv with

pip install grpcio{,-tools} betterproto[compiler]==2.0.0b4

Gives:

python -m grpc_tools.protoc -I . --python_betterproto_out=lib example.proto
--python_betterproto_out: protoc-gen-python_betterproto: Plugin failed with status code 1.

I noticed that grpcio and grpcio-tools pip packages both were updated to 1.44.0 yesterday and suspected this was the culprit, however when I setup the virtualenv with:

pip install grpcio{,-tools}==1.43.0 betterproto[compiler]==2.0.0b4

I still get the same error.

This was working fine 2 days ago when I last regenerated my protobufs with a script that set's up the virtualenv's as described above. I'm very confused why using version grpcio 1.43.0 gives the same error here as I thought this was the exact setup that was working for me 2 days ago.. has anything else changed that I'm missing?

Thanks

Edit: using betterproto 1.2.5 with grpcio-tools 1.44.0 works, but this isn't ideal as it generates files with bad imports

@Gobot1234
Copy link
Collaborator

Can you try on master, I fear this may be related to bc3cfc5

@Gobot1234 Gobot1234 added the compiler-bug The compiler is broken label Feb 18, 2022
@jialex
Copy link

jialex commented Feb 18, 2022

FYI - we're also seeing this on 2.0.0b3 with buf (buf.build):

python -m pip install -U build betterproto[compiler]==2.0.0b3 buf generate -vvv --debug

gives us:

DEBUG get_ref {"duration": "64.529µs"} DEBUG get_config {"duration": "217.361µs"} DEBUG get_workspace_config {"duration": "102.135µs"} DEBUG get_config {"duration": "227.973µs"} DEBUG get_config {"duration": "8.059µs"} DEBUG get_module_config {"duration": "1.059468ms"} DEBUG cache_miss {"module_pin": "buf.build/googleapis/googleapis:054ad027c6734cf592282dfd22f4f45e"} buf: downloading buf.build/googleapis/googleapis:054ad027c6734cf592282dfd22f4f45e DEBUG grpcclient dial {"address": "dns:///api.buf.build"} DEBUG buf.alpha.registry.v1alpha1.DownloadService.Download {"duration": "7.112438101s", "Client": true, "FailFast": true} DEBUG buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoryByFullName {"duration": "165.636774ms", "Client": true, "FailFast": true} DEBUG parse {"duration": "32.909146ms"} DEBUG get_image {"duration": "73.023µs"} DEBUG build {"duration": "33.776587ms"} DEBUG build_module {"duration": "33.785571ms"} DEBUG plugin_proxy {"duration": "469.215786ms", "plugin": "protoc-gen-python_betterproto"} DEBUG command {"duration": "18.392375154s"} Failure: plugin python_betterproto: exit status 1 make: *** [Makefile:15: protos] Error 1

We also tried versions 2.0.0b1, 2.0.0b2, 2.0.0b4 - they all have the same issue. We haven't changed anything either since yesterday, and this issue started this morning.

Also confirmed betterproto 1.2.5 builds the protos, but breaks everything with the bad imports.

@klvmungai
Copy link

This seems to have been caused by a recent release of the markupsafe package https://pypi.org/project/MarkupSafe/#history
locking the package to 2.0.1 worked for us python -m pip install -U build markupsafe==2.0.1 betterproto[compiler]==2.0.0b3

@abn
Copy link
Collaborator

abn commented Feb 28, 2022

Looks like this comes from jinja2. The upstream issue is at pallets/jinja#1585. This should be resolved via the jinja2 update in #330.

The current issue is 2.0.0b4 requires jinja2>=2.11.2,<3.0.0 as per the package metadata. Tne next release should relax this.

@hypdeb
Copy link

hypdeb commented Apr 9, 2022

Would be willing to help with that. Kind of blocking as I need metadata exposed in procedure signatures and it's only available in the preview version. Anything I can do to help getting the next release out ?

@honglei
Copy link

honglei commented Apr 20, 2022

release A new pre-release?

@krsteve
Copy link

krsteve commented May 3, 2022

This hasn't been fixed yet --- 2.0.0b5 cannot come soon enough.

@marianhlavac
Copy link

Any update on this? It's kind of a blocker.

@engelnico
Copy link

engelnico commented Jun 24, 2022

For me, manually upgrading jinja2 after installing the prerelease of betterproto worked:

pip install --pre "betterproto[compiler]"
pip install --upgrade jinja2

Tested with betterproto v2.0.0b4 and jinja2 v3.1.2.
But I agree with all of you, this is rather annoying and I hope for a quick release of b5. eeddc84 addresses this too.

@Gobot1234
Copy link
Collaborator

As b5 has been released, I'm closing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler-bug The compiler is broken
Projects
None yet
Development

No branches or pull requests

10 participants