Skip to content

Commit

Permalink
Also include submodules & and continue on error (#503)
Browse files Browse the repository at this point in the history
* Also include submodules

* drop python 3.8, almost EOL

* typo

* dont fail full step if job fails

* add more pre commits

* rename for clarity

* lets try this

* nah i think we want this
  • Loading branch information
gijzelaerr committed May 3, 2024
1 parent 2bb1460 commit 8035ef7
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: build-and-test-wheels
name: Build and test wheels AMD64
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
linux-build-86_64:
name: Build wheel for linux x86_64
linux-build:
name: Build wheel for linux AMD64
runs-on: ubuntu-20.04
steps:
- name: Checkout
Expand All @@ -31,7 +31,7 @@ jobs:
path: wheelhouse/${{ runner.os }}/*.whl

windows-build:
name: Build wheel for windows
name: Build wheel for windows AMD64
runs-on: windows-2022
steps:
- name: Checkout
Expand All @@ -55,7 +55,7 @@ jobs:
path: wheelhouse/${{ runner.os }}/*.whl

osx-build:
name: Build wheel for osx
name: Build wheel for osx AMD64
runs-on: macos-11
steps:
- name: Checkout
Expand Down Expand Up @@ -91,13 +91,14 @@ jobs:


test-wheels-86_64:
name: Testing wheels
needs: [linux-build-86_64, windows-build, osx-build]
name: Testing wheels for AMD64
needs: [linux-build, windows-build, osx-build]
continue-on-error: true
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2022, macos-14]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-22.04, ubuntu-20.04, macos-14, macos-11, windows-2022, windows-2019]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/build-and-test-arm64.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: build-and-test-wheels-arm64
name: Build and test wheels ARM64
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
linux-build-aarch64:
linux-build-arm64:
name: Build wheel for linux arm64
runs-on: ubuntu-20.04
steps:
Expand All @@ -20,7 +20,7 @@ jobs:
with:
platforms: arm64

- name: Build wheel
- name: Build wheel for aarch64
uses: ./.github/actions/manylinux_2_28_aarch64
with:
script: ./.github/build_scripts/build_package.sh
Expand All @@ -34,13 +34,14 @@ jobs:
name: wheels
path: wheelhouse/*.whl

test-wheels-aarch64:
name: Testing wheel
needs: linux-build-aarch64
test-wheels-arm64:
name: Testing wheel for arm64
needs: linux-build-arm64
continue-on-error: true
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Linux Test all Pythons
name: Linux Test all Pythons with Debian packages
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ["ubuntu-20.04", "ubuntu-22.04"]
runs-on: ${{ matrix.runs-on }}
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -32,5 +34,5 @@ jobs:
venv/bin/pip install ".[test]"
- name: Run pytest
run: |
venv/bin/pytest tests/test_client.py tests/test_mainloop.py tests/test_server.py tests/test_util.py
sudo venv/bin/pytest tests/test_partner.py
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/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.9'
- uses: pre-commit/[email protected]
29 changes: 11 additions & 18 deletions .github/workflows/test-pypi-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04, macos-14, macos-11, windows-2022, windows-2019]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -16,27 +16,20 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install pytest
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pytest
- name: install python-snap7
run: python3 -m pip install -i https://test.pypi.org/simple/ python-snap7
run: |
python3 -m venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install -i https://test.pypi.org/simple/ python-snap7[test]
- name: Run pytest
run: |
which pytest
pytest -m "server or util or client or mainloop"
- name: Run tests required sudo
if: ${{ runner.os == 'Linux'}}
run: sudo /opt/hostedtoolcache/Python/${{ matrix.python-version }}*/x64/bin/pytest -m partner
venv/bin/pytest -m "server or util or client or mainloop"
- name: Run tests required sudo
if: ${{ runner.os == 'macOS'}}
run: sudo pytest -m partner
- name: Run tests required sudo on Linux and macOS
if: ${{ runner.os == 'Linux' || runner.os == 'macOS'}}
run: sudo venv/bin/pytest -m partner

- name: Run tests required sudo
- name: On windows we don't need sudo
if: ${{ runner.os == 'Windows'}}
run: pytest -m partner
run: venv/bin/pytest -m partner
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ repos:
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-ast
- id: check-json
- id: check-toml
- id: check-xml
- id: check-yaml
- id: check-merge-conflict
- id: debug-statements
- id: check-builtin-literals
- id: check-case-conflict
Expand All @@ -25,3 +27,4 @@ repos:
rev: 'v0.4.2'
hooks:
- id: ruff
- id: ruff-format
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is a ctypes-based Python wrapper for snap7. Snap7 is an open-source,
32/64 bit, multi-platform Ethernet communication suite for interfacing natively
with Siemens S7 PLCs.

Python-snap7 is tested with Python 3.8+, on Windows, Linux and OS X.
Python-snap7 is tested with Python 3.9+, on Windows, Linux and OS X.

The full documentation is available on `Read The Docs <https://python-snap7.readthedocs.io/en/latest/>`_.

Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ doc = ["sphinx", "sphinx_rtd_theme"]
snap7 = ["py.typed", "lib/libsnap7.so", "lib/snap7.dll", "lib/libsnap7.dylib"]

[tool.setuptools.packages.find]
where = ["."]
include = ["snap7", "snap7.lib"]
include = ["snap7*"]

[project.scripts]
snap7-server = "snap7.server.__main__:main"
Expand Down

0 comments on commit 8035ef7

Please sign in to comment.