From 1d0539f5fa58719ac1928310ed86039e92a44c3f Mon Sep 17 00:00:00 2001 From: Gijs Molenaar Date: Fri, 3 May 2024 11:26:54 +0200 Subject: [PATCH] use venv everywhere (#505) * use venv everywhere * fix windows --- .github/workflows/build-and-test-amd64.yml | 66 ++++++++++++------- .github/workflows/build-and-test-arm64.yml | 9 +-- .../{linux.yml => linux-test-with-deb.yml} | 0 .github/workflows/osx-test-with-brew.yml | 27 ++++++++ .github/workflows/osx.yml | 24 ------- .../{windows.yml => windows-test.yml} | 11 +++- 6 files changed, 86 insertions(+), 51 deletions(-) rename .github/workflows/{linux.yml => linux-test-with-deb.yml} (100%) create mode 100644 .github/workflows/osx-test-with-brew.yml delete mode 100644 .github/workflows/osx.yml rename .github/workflows/{windows.yml => windows-test.yml} (67%) diff --git a/.github/workflows/build-and-test-amd64.yml b/.github/workflows/build-and-test-amd64.yml index 4ff5bf6c..60d9ba0c 100644 --- a/.github/workflows/build-and-test-amd64.yml +++ b/.github/workflows/build-and-test-amd64.yml @@ -90,14 +90,14 @@ jobs: path: wheelhouse/${{ runner.os }}/*.whl - test-wheels-86_64: - name: Testing wheels for AMD64 - needs: [linux-build, windows-build, osx-build] + test-wheels-unix-86_64: + name: Testing wheels for AMD64 unix + needs: [linux-build, osx-build] continue-on-error: true runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, ubuntu-20.04, macos-14, macos-11, windows-2022, windows-2019] + os: [ubuntu-22.04, ubuntu-20.04, macos-14, macos-11] python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - name: Checkout @@ -108,11 +108,6 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install pytest - run: | - python3 -m pip install --upgrade pip - python3 -m pip install pytest - - name: Download artifacts uses: actions/download-artifact@v4 with: @@ -120,21 +115,48 @@ jobs: path: wheelhouse - name: Install python-snap7 - run: python3 -m pip install $(ls wheelhouse/*.whl) + run: | + python3 -m venv venv + venv/bin/pip install --upgrade pip + venv/bin/pip install pytest + venv/bin/pip install $(ls wheelhouse/*.whl) - - name: Run pytest + - name: Run tests run: | - which pytest - pytest -m "server or util or client or mainloop" + venv/bin/pytest -m "server or util or client or mainloop" + sudo venv/bin/pytest -m partner - - name: Run tests required sudo - if: ${{ runner.os == 'Linux'}} - run: sudo /opt/hostedtoolcache/Python/${{ matrix.python-version }}*/x64/bin/pytest -m partner - - name: Run tests required sudo - if: ${{ runner.os == 'macOS'}} - run: sudo pytest -m partner - - name: Run tests required sudo - if: ${{ runner.os == 'Windows'}} - run: pytest -m partner + test-wheels-windows-86_64: + name: Testing wheels for AMD64 windows + needs: [windows-build,] + continue-on-error: true + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-2022, windows-2019] + python-version: ["3.9", "3.10", "3.11", "3.12"] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: wheels-${{ runner.os }} + path: wheelhouse + + - name: Install python-snap7 + run: | + python3 -m pip install --upgrade pip pytest + python3 -m pip install $(ls wheelhouse/*.whl) + + - name: Run pytest + run: | + pytest -m "server or util or client or mainloop or partner" diff --git a/.github/workflows/build-and-test-arm64.yml b/.github/workflows/build-and-test-arm64.yml index 1dedcdd7..f535b06c 100644 --- a/.github/workflows/build-and-test-arm64.yml +++ b/.github/workflows/build-and-test-arm64.yml @@ -63,8 +63,9 @@ jobs: -v $PWD/pyproject.toml:/pyproject.toml \ -v $PWD/wheelhouse:/wheelhouse \ "arm64v8/python:${{ matrix.python-version }}-bookworm" /bin/bash -s <