GoogleCloudPlatform / cloud-profiler-python

Stackdriver Profiler Python agent is a tool that continuously gathers CPU usage information from Python applications
Apache License 2.0
27 stars 23 forks source link

profile_pb2.py code is outdated and needs to be regenerated #135

Closed riteshghorse closed 1 year ago

riteshghorse commented 1 year ago

With latest release of protobuf, the profile_pb2.py needs to be regenerated. We are facing an issue in Apache Beam Python SDK importing the googlecloudprofiler which throws the protobuf version exception image

aabmass commented 1 year ago

Can you share the versions of dependencies you're using or a repro? I'm unable to reproduce this locally with a fresh virtualenv and latest versions of protobuf and google-cloud-profiler

# in a new dir
python3 -m venv venv
source venv/bin/activate
pip install google-cloud-profiler protobuf==4.22.1
python -c 'from googlecloudprofiler import profile_pb2'
# no error

output of pip freeze

cachetools==5.3.0
certifi==2022.12.7
charset-normalizer==3.1.0
google-api-core==2.11.0
google-api-python-client==2.85.0
google-auth==2.17.2
google-auth-httplib2==0.1.0
google-cloud-profiler==4.0.0
googleapis-common-protos==1.59.0
httplib2==0.22.0
idna==3.4
protobuf==4.22.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
pyparsing==3.0.9
requests==2.28.2
rsa==4.9
six==1.16.0
uritemplate==4.1.1
urllib3==1.26.15
riteshghorse commented 1 year ago

Importing it locally in a interpreter worked fine for me. It looks like our dev containers aren't updated yet which may have caused this issue. Closing this one for now. Thanks for investigating Aaron!