Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix read the docs & improve use of enum types #515

Merged
merged 9 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 0 additions & 160 deletions .github/workflows/build-and-test-amd64.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
env:
IMAGE_NAME: python-snap7
jobs:
push:
runs-on: ubuntu-latest
build-and-push-container-image:
runs-on: ubuntu-20.04
permissions:
packages: write
contents: read
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/linux-build-test-amd64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and test wheels linux/amd64
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
linux-build-amd64:
name: Build wheel for linux AMD64
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare snap7 archive
uses: ./.github/actions/prepare_snap7

- name: Build wheel
uses: ./.github/actions/manylinux_2_28_x86_64
with:
script: ./.github/build_scripts/build_package.sh
platform: manylinux_2_28_x86_64
makefile: x86_64_linux.mk
python: /opt/python/cp38-cp38/bin/python
wheeldir: wheelhouse/${{ runner.os }}/

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ runner.os }}
path: wheelhouse/${{ runner.os }}/*.whl



linux-test-amd64:
name: Testing wheels for linux/amd64
needs: linux-build-amd64
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04"]
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 venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install pytest
venv/bin/pip install wheelhouse/*.whl

- name: Run tests
run: |
venv/bin/pytest -m "server or util or client or mainloop"
sudo venv/bin/pytest -m partner
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and test wheels ARM64
name: Build and test wheels linux/arm64
on:
push:
branches: [master]
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
name: wheels
path: wheelhouse/*.whl

test-wheels-arm64:
linux-test-arm64:
name: Testing wheel for arm64
needs: linux-build-arm64
runs-on: ubuntu-20.04
Expand All @@ -61,6 +61,7 @@ jobs:
docker run --rm --interactive -v $PWD/tests:/tests \
-v $PWD/pyproject.toml:/pyproject.toml \
-v $PWD/wheelhouse:/wheelhouse \
--platform linux/arm64 \
"arm64v8/python:${{ matrix.python-version }}-bookworm" /bin/bash -s <<EOF
python3 -m venv venv
venv/bin/pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux-test-with-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ["ubuntu-20.04", "ubuntu-22.04"]
runs-on: ["ubuntu-20.04", "ubuntu-22.04", "ubuntu-24.04"]
runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/osx-build-test-amd64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Build and test wheels osx/amd64
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:


osx-build:
name: Build wheel for OSX
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare snap7 archive
uses: ./.github/actions/prepare_snap7

- name: Prepare files
run: |
cp .github/build_scripts/arm64_osx.mk snap7-full-1.4.2/build/osx/
pushd snap7-full-1.4.2/build/osx/
make -f x86_64_osx.mk all
make -f arm64_osx.mk all
lipo -create -output /usr/local/lib/libsnap7.dylib ../bin/x86_64-osx/libsnap7.dylib ../bin/arm64-osx/libsnap7.dylib
install_name_tool -id /usr/local/lib/libsnap7.dylib /usr/local/lib/libsnap7.dylib
popd
mkdir -p snap7/lib/
cp /usr/local/lib/libsnap7.dylib snap7/lib/

- name: Build wheel
run: |
python3 -m build . --wheel -C="--build-option=--plat-name=macosx_10_9_universal2"
mkdir -p wheelhouse/${{ runner.os }}/
cp dist/*.whl wheelhouse/${{ runner.os }}/

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ runner.os }}
path: wheelhouse/${{ runner.os }}/*.whl


osx-test:
name: Testing wheels for OSX
needs: osx-build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14, macos-12]
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 venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install pytest
venv/bin/pip install wheelhouse/*.whl

- name: Run tests
run: |
venv/bin/pytest -m "server or util or client or mainloop"
sudo venv/bin/pytest -m partner
2 changes: 1 addition & 1 deletion .github/workflows/osx-test-with-brew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
runs-on: [ "macos-14", "macos-11" ]
runs-on: [ "macos-14", "macos-12" ]
runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-pypi-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04, macos-14, macos-11, windows-2022, windows-2019]
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, macos-14, macos-12, windows-2022, windows-2019]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
Expand Down
Loading
Loading