From 9a87b87ac0cc305600c6fb90ad81a08c3cc8ed96 Mon Sep 17 00:00:00 2001 From: Taoning Wang Date: Tue, 25 Apr 2023 09:43:41 -0700 Subject: [PATCH 1/2] fix(CI): update publish action --- .github/workflows/python-publish.yml | 76 +++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 035d5fb..d21ad0f 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -13,23 +13,87 @@ on: types: [published] jobs: - deploy: - + deploy_linux: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout pyradiance + uses: actions/checkout@v3 + - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: '3.8' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + + - name: Build Wheels + run: | + git submodule update --init --recursive + pip install requests wheel auditwheel pytest + python setup.py bdist_wheel + + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + + deploy_macos: + runs-on: macos-latest + + steps: + - name: Checkout pyradiance + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.8' + - name: Install dependencies run: | python -m pip install --upgrade pip pip install build - - name: Build package - run: python -m build + - name: Build Wheels + run: | + git submodule update --init --recursive + pip install requests wheel auditwheel pytest + python setup.py bdist_wheel + + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + + deploy_windows: + runs-on: windows-latest + + steps: + - name: Checkout pyradiance + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.8' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + + - name: Build Wheels + run: | + git submodule update --init --recursive + pip install requests wheel auditwheel pytest + python setup.py bdist_wheel + - name: Publish package uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: From ee2c9899834922dcdac0e657f03e2326e3bae5c7 Mon Sep 17 00:00:00 2001 From: Taoning Wang Date: Tue, 25 Apr 2023 09:48:19 -0700 Subject: [PATCH 2/2] refactor(anci) --- pyradiance/anci.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pyradiance/anci.py b/pyradiance/anci.py index 6fe299c..f4a46b4 100644 --- a/pyradiance/anci.py +++ b/pyradiance/anci.py @@ -17,10 +17,8 @@ def wrapper(*args, **kwargs): try: result = func(*args, **kwargs) except CalledProcessError as e: - err = "" - if e.stderr is not None: - err = e.stderr.decode() - raise RuntimeError(f"An error occurred with exit code {e.returncode}: {err}") + errmsg = e.stderr or b"" + raise RuntimeError(f"An error occurred with exit code {e.returncode}: {errmsg.decode()}") else: return result return wrapper