Skip to content

Commit

Permalink
Merge pull request #6 from ni/users/gregstoll/linux-generate-protobuf
Browse files Browse the repository at this point in the history
Fix generate_protobuf_classes on Linux
  • Loading branch information
gregstoll authored Dec 11, 2020
2 parents 3c13ac2 + 819ff35 commit 93411fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
build-and-publish:
if: github.repository == 'ni/niflexlogger-automation-python'
runs-on: windows-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
Expand All @@ -19,10 +19,10 @@ jobs:
python-version: 3.8

- name: Install setuptools and other tools
run: python -m pip install setuptools wheel twine grpcio grpcio-tools
run: python3 -m pip install setuptools wheel twine grpcio grpcio-tools

- name: Build packages
run: python setup.py bdist_wheel
run: python3 setup.py bdist_wheel

- name: Publish distribution to PyPI
if: github.event.action == 'published'
Expand Down
5 changes: 4 additions & 1 deletion generate_protobuf_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys
from itertools import chain
from pathlib import Path
from shlex import quote

PROTO_PATHS = [
"ConfigurationBasedSoftware/FlexLogger/Automation/FlexLogger.Automation.Protocols",
Expand Down Expand Up @@ -78,7 +79,9 @@ def _call_protoc() -> int:
]

cwd = "./src" if _has_src_dir() else None
return subprocess.run([sys.executable, "-m", "grpc_tools.protoc"] + args, cwd=cwd).returncode
# Need to run with shell=True so the .proto files will get
# globbed on Linux.
return subprocess.run(' '.join([quote(sys.executable), "-m", "grpc_tools.protoc"] + args), cwd=cwd, shell=True).returncode


if __name__ == "__main__":
Expand Down

0 comments on commit 93411fc

Please sign in to comment.