Skip to content

Commit

Permalink
use venv everywhere (#505)
Browse files Browse the repository at this point in the history
* use venv everywhere

* fix windows
  • Loading branch information
gijzelaerr authored May 3, 2024
1 parent c2b1c46 commit 1d0539f
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 51 deletions.
66 changes: 44 additions & 22 deletions .github/workflows/build-and-test-amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -108,33 +108,55 @@ 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:
name: wheels-${{ runner.os }}
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"
9 changes: 5 additions & 4 deletions .github/workflows/build-and-test-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ jobs:
-v $PWD/pyproject.toml:/pyproject.toml \
-v $PWD/wheelhouse:/wheelhouse \
"arm64v8/python:${{ matrix.python-version }}-bookworm" /bin/bash -s <<EOF
python3 -m pip install --upgrade pip
python3 -m pip install $(ls wheelhouse/*_aarch64.whl)
python3 -m pip install pytest
python3 -m pytest tests/test_client.py tests/test_mainloop.py tests/test_server.py tests/test_util.py
python3 -m venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install pytest
venv/bin/pip install $(ls wheelhouse/*.whl)
venv/bin/pytest -m "server or util or client or mainloop or partner"
EOF
File renamed without changes.
27 changes: 27 additions & 0 deletions .github/workflows/osx-test-with-brew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: OS X Test
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
osx_wheel:
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
runs-on: [ "macos-14", "macos-11" ]
runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install snap7
run: brew install snap7 python@${{ matrix.python-version }}
- name: Install python-snap7
run: |
python${{ matrix.python-version }} -m venv venv
venv/bin/python3 -m pip install --upgrade pip setuptools
venv/bin/python3 -m pip install -e .[test]
- name: Run pytest
run: |
venv/bin/pytest -m "server or util or client or mainloop"
sudo venv/bin/pytest -m partner
24 changes: 0 additions & 24 deletions .github/workflows/osx.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@ on:
jobs:
windows_wheel:
continue-on-error: true
runs-on: windows-2022
strategy:
matrix:
runs-on: [ "windows-2022", "windows-2019" ]
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.runs-on }}
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: Prepare snap7 archive
uses: ./.github/actions/prepare_snap7

Expand Down

0 comments on commit 1d0539f

Please sign in to comment.