Skip to content

Commit

Permalink
Python build
Browse files Browse the repository at this point in the history
  • Loading branch information
thecardcheat committed Feb 13, 2022
1 parent 2b1a987 commit 3669386
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/python.yml
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
- name: Python artifact
uses: actions/upload-artifact@v2
with:
name: helium_proto
path: generated/helium
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
betterproto[compiler]>=2.0.0b4,<3
38 changes: 38 additions & 0 deletions requirements.txt
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
1 change: 1 addition & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip-tools>=6.5.1,<7

0 comments on commit 3669386

Please sign in to comment.