-
Notifications
You must be signed in to change notification settings - Fork 30
Python #119
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
base: master
Are you sure you want to change the base?
Python #119
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Python CI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
tags: ['v*'] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
- name: Install protoc | ||
run: sudo apt install protobuf-compiler | ||
- name: Install requirements | ||
run: pip install -r requirements.txt | ||
- name: Build python module | ||
run: mkdir generated && protoc -I src --python_betterproto_out=generated/ src/*.proto src/service/*.proto | ||
# Appears related to https://github.com/danielgtaylor/python-betterproto/issues/238 but we need the latest beta of | ||
# betterproto to build src/service/*.proto | ||
- name: Trim python module | ||
run: sed -i '/from . import /d' generated/helium/__init__.py | ||
madninja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Python artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: helium_proto | ||
path: generated/helium |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
betterproto[compiler]>=2.0.0b4,<3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# | ||
# This file is autogenerated by pip-compile with python 3.10 | ||
# To update, run: | ||
# | ||
# pip-compile | ||
# | ||
betterproto[compiler]==2.0.0b4 | ||
# via -r requirements.in | ||
black==22.1.0 | ||
# via betterproto | ||
click==8.0.3 | ||
# via black | ||
grpclib==0.4.2 | ||
# via betterproto | ||
h2==4.1.0 | ||
# via grpclib | ||
hpack==4.0.0 | ||
# via h2 | ||
hyperframe==6.0.1 | ||
# via h2 | ||
jinja2==2.11.3 | ||
# via betterproto | ||
markupsafe==2.0.1 | ||
# via jinja2 | ||
multidict==6.0.2 | ||
# via grpclib | ||
mypy-extensions==0.4.3 | ||
# via black | ||
pathspec==0.9.0 | ||
# via black | ||
platformdirs==2.5.0 | ||
# via black | ||
python-dateutil==2.8.2 | ||
# via betterproto | ||
six==1.16.0 | ||
# via python-dateutil | ||
tomli==2.0.1 | ||
# via black |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pip-tools>=6.5.1,<7 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
syntax = "proto3"; | ||
|
||
package helium; | ||
|
||
import "blockchain_block_v1.proto"; | ||
|
||
message blockchain_block { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
syntax = "proto3"; | ||
|
||
package helium; | ||
|
||
import "blockchain_txn.proto"; | ||
|
||
message blockchain_signature_v1 { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
syntax = "proto3"; | ||
|
||
package helium; | ||
|
||
message blockchain_gossip_block { | ||
bytes from = 1; | ||
bytes block = 2; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
syntax = "proto3"; | ||
|
||
package helium; | ||
|
||
message blockchain_snapshot_req { | ||
uint64 height = 1; | ||
bytes hash = 2; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
syntax = "proto3"; | ||
|
||
package helium; | ||
|
||
message blockchain_sync_hash { | ||
bytes hash = 1; | ||
repeated uint64 heights = 2; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ syntax = "proto3"; | |
package helium; | ||
|
||
enum origin { | ||
p2p = 0; | ||
radio = 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please don’t rename fields There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was done due to the following error:
This appears to be an issue with protobuf namespacing, I'm not sure why things that aren't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem is that it'll break existing erlang and rust users of this message. Perhaps we're missing a protoc option here since Prost (rust) uses protoc under the hood and does not appear to have this issue There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will try to dig into those a little bit more to compare, thanks for the tip. |
||
origin_p2p = 0; | ||
origin_radio = 1; | ||
} | ||
|
||
message blockchain_poc_receipt_v1 { | ||
|
Uh oh!
There was an error while loading. Please reload this page.