Skip to content

Commit 3669386

Browse files
committed
Python build
1 parent 2b1a987 commit 3669386

File tree

4 files changed

+73
-0
lines changed

4 files changed

+73
-0
lines changed

.github/workflows/python.yml

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