Skip to content

Commit c4470ac

Browse files
committed
Python build
1 parent 2b1a987 commit c4470ac

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed

.github/workflows/python.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
on:
2+
push:
3+
branches: [ master ]
4+
tags: ['v*']
5+
pull_request:
6+
branches: [ master ]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python 3.10
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: "3.10"
17+
- name: Install protoc
18+
run: sudo apt install protobuf-compiler
19+
- name: Install requirements
20+
run: pip install -r requirements.txt
21+
- name: Build python module
22+
run: mkdir generated && protoc -I src --python_betterproto_out=generated/ src/*.proto src/service/*.proto
23+
# Appears related to https://github.com/danielgtaylor/python-betterproto/issues/238 but we need the latest beta of
24+
# betterproto to build src/service/*.proto
25+
- name: Trim python module
26+
run: sed -i '/from . import /d' generated/helium/__init__.py
27+
- name: Python artifact
28+
uses: actions/upload-artifact@v2
29+
with:
30+
name: helium_proto
31+
path: generated/helium

requirements.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
betterproto[compiler]>=2.0.0b4,<3

requirements.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# This file is autogenerated by pip-compile with python 3.10
3+
# To update, run:
4+
#
5+
# pip-compile
6+
#
7+
betterproto[compiler]==2.0.0b4
8+
# via -r requirements.in
9+
black==22.1.0
10+
# via betterproto
11+
click==8.0.3
12+
# via black
13+
grpclib==0.4.2
14+
# via betterproto
15+
h2==4.1.0
16+
# via grpclib
17+
hpack==4.0.0
18+
# via h2
19+
hyperframe==6.0.1
20+
# via h2
21+
jinja2==2.11.3
22+
# via betterproto
23+
markupsafe==2.0.1
24+
# via jinja2
25+
multidict==6.0.2
26+
# via grpclib
27+
mypy-extensions==0.4.3
28+
# via black
29+
pathspec==0.9.0
30+
# via black
31+
platformdirs==2.5.0
32+
# via black
33+
python-dateutil==2.8.2
34+
# via betterproto
35+
six==1.16.0
36+
# via python-dateutil
37+
tomli==2.0.1
38+
# via black

requirements_dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pip-tools>=6.5.1,<7

0 commit comments

Comments
 (0)