From edadfc618887b6f0a55ffcbaa5abf682f474f5da Mon Sep 17 00:00:00 2001 From: Greg Stoll Date: Fri, 11 Dec 2020 14:29:06 -0600 Subject: [PATCH 1/2] restore building on linux --- .github/workflows/publish-to-pypi.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 460a78f..063e15b 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -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 @@ -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' From 819ff35590586a4f8b348afba3a9b5a3830d56d9 Mon Sep 17 00:00:00 2001 From: Greg Stoll Date: Fri, 11 Dec 2020 14:31:40 -0600 Subject: [PATCH 2/2] fix generate_protobuf_classes on Linux --- generate_protobuf_classes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/generate_protobuf_classes.py b/generate_protobuf_classes.py index 4f75c48..1e7cd84 100644 --- a/generate_protobuf_classes.py +++ b/generate_protobuf_classes.py @@ -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", @@ -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__":