Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 1976842

Browse files
committed
Bug 1341566 Regenerate protobuf classes
Also adds documentation on how to regenerate the classes in the future.
1 parent 79db9ac commit 1976842

4 files changed

Lines changed: 56 additions & 43 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ bin/update_parser_scripts
2222
```
2323
Note that this file was formerly called histogram_tools.py and was renamed in Bug 1419761.
2424

25+
## Updating message_pb2.py
26+
27+
`moztelemetry/heka/message_pb2.py` is generated from
28+
[mozilla-services/heka](https://github.com/mozilla-services/heka/blob/dev/message/message.proto).
29+
To regenerate it, you'll need to install a `protobuf` package for your system.
30+
To avoid installing go-specific extensions, remove the `gogo.proto` import
31+
and the `gogoproto` options and then run `protoc`:
32+
33+
```
34+
git clone https://github.com/mozilla-services/heka
35+
mkdir pythonfiles/
36+
protoc -I heka/message --python_out pythonfiles/ heka/message/message.proto
37+
```
38+
2539
## Testing locally
2640

2741
To test/debug this package locally, you can run exactly the job that

moztelemetry/heka/message_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from io import BytesIO
1414
from google.protobuf.message import DecodeError
1515

16+
# See instructions in the README for how to regenerate these classes.
1617
from .message_pb2 import Message, Header
1718

1819

moztelemetry/heka/message_pb2.py

Lines changed: 39 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
url='https://github.com/mozilla/python_moztelemetry',
1919
packages=find_packages(),
2020
package_dir={'moztelemetry': 'moztelemetry'},
21-
install_requires=['boto', 'boto3', 'ujson', 'requests', 'protobuf', 'six',
21+
install_requires=['boto', 'boto3', 'ujson', 'requests',
22+
'protobuf>=3.6.0', 'six',
2223
'expiringdict', "functools32;python_version<'3'", 'py4j',
2324
'pandas>=0.19.2', 'numpy>=1.8.2',
2425
'PyYAML', 'python-snappy'],

0 commit comments

Comments
 (0)