From 0ce5265624b5823bc7b6fb03dcbdd95eedd59fa4 Mon Sep 17 00:00:00 2001 From: George Waters Date: Fri, 17 Dec 2021 16:23:58 -0500 Subject: [PATCH 1/2] Explicitly cast float to mp_int_t Not sure why this is necessary, but it prevents an off-by-one error in some (rare?) circumstances. --- shared-module/adafruit_pixelbuf/PixelBuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/adafruit_pixelbuf/PixelBuf.c b/shared-module/adafruit_pixelbuf/PixelBuf.c index bfeab4ae04..99980c705e 100644 --- a/shared-module/adafruit_pixelbuf/PixelBuf.c +++ b/shared-module/adafruit_pixelbuf/PixelBuf.c @@ -163,7 +163,7 @@ STATIC void _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t color, } if (mp_obj_is_int(color) || mp_obj_is_float(color)) { - mp_int_t value = mp_obj_is_int(color) ? mp_obj_get_int_truncated(color) : mp_obj_get_float(color); + mp_int_t value = mp_obj_is_int(color) ? mp_obj_get_int_truncated(color) : (mp_int_t)mp_obj_get_float(color); *r = value >> 16 & 0xff; *g = (value >> 8) & 0xff; *b = value & 0xff; From d61d8b1020ab333d8c44baadafb1919f59c93a0a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 20 Dec 2021 18:28:09 -0600 Subject: [PATCH 2/2] set up python 3.x and use setup-python@v2 --- .github/workflows/build.yml | 42 ++++++++++++------------- .github/workflows/create_website_pr.yml | 6 ++-- .github/workflows/pre-commit.yml | 5 ++- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d55e947ab..38d86bae0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,10 +30,10 @@ jobs: with: submodules: false fetch-depth: 1 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - name: Set up Python 3 + uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: "3.x" - name: Get CP deps run: python tools/ci_fetch_deps.py test ${{ github.sha }} - name: CircuitPython version @@ -136,10 +136,10 @@ jobs: with: submodules: false fetch-depth: 1 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - name: Set up Python 3 + uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: "3.x" - name: Get CP deps run: python tools/ci_fetch_deps.py mpy-cross-mac ${{ github.sha }} - name: CircuitPython version @@ -202,10 +202,10 @@ jobs: run: | git describe --dirty --tags echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags) - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - name: Set up Python 3 + uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: "3.x" - name: Install dependencies run: | sudo apt-get update @@ -260,10 +260,10 @@ jobs: board: ${{ fromJSON(needs.test.outputs.boards-arm) }} if: ${{ needs.test.outputs.boards-arm != '[]' }} steps: - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - name: Set up Python 3 + uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: "3.x" - uses: actions/checkout@v2.2.0 with: submodules: false @@ -312,10 +312,10 @@ jobs: board: ${{ fromJSON(needs.test.outputs.boards-riscv) }} if: ${{ needs.test.outputs.boards-riscv != '[]' }} steps: - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - name: Set up Python 3 + uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: "3.x" - uses: actions/checkout@v2.2.0 with: submodules: false @@ -364,10 +364,10 @@ jobs: board: ${{ fromJSON(needs.test.outputs.boards-espressif) }} if: ${{ needs.test.outputs.boards-espressif != '[]' }} steps: - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - name: Set up Python 3 + uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: "3.x" - uses: actions/checkout@v2.2.0 with: submodules: false @@ -451,10 +451,10 @@ jobs: board: ${{ fromJSON(needs.test.outputs.boards-aarch) }} if: ${{ needs.test.outputs.boards-aarch != '[]' }} steps: - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - name: Set up Python 3 + uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: "3.x" - uses: actions/checkout@v2.2.0 with: submodules: false diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index 007cfbd402..dc987f0989 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -20,10 +20,10 @@ jobs: with: submodules: false fetch-depth: 1 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - name: Set up Python 3 + uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: "3.x" - name: Get CP deps run: python tools/ci_fetch_deps.py website ${{ github.sha }} - name: Install deps diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 2a8811115e..02db3b2c61 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -13,7 +13,10 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2.2.0 - - uses: actions/setup-python@v1 + - name: Set up Python 3 + uses: actions/setup-python@v2 + with: + python-version: "3.x" - name: Install deps run: | sudo apt-add-repository -y -u ppa:pybricks/ppa