Skip to content

Commit f75a116

Browse files
authored
Merge branch 'gijzelaerr:master' into master
2 parents 3e2059e + 9ab5c72 commit f75a116

27 files changed

Lines changed: 1254 additions & 408 deletions
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
TargetCPU :=x86_64
2+
OS :=osx
3+
CXXFLAGS := -O3 -fPIC -pedantic -target x86_64-apple-darwin
4+
5+
# Standard part
6+
7+
include common.mk
8+
9+
# Override the variable to add a target flag
10+
SharedObjectLinkerName :=g++ -shared -fPIC --target=x86_64-apple-darwin

.github/workflows/doc.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,26 @@ on:
44
branches: [master]
55
pull_request:
66
branches: [master]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
710
jobs:
811
build:
9-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-24.04
1013
steps:
1114
- name: Checkout
1215
uses: actions/checkout@v4
13-
- name: Install Debian packages
14-
run: |
15-
sudo apt-get update -qq
16-
sudo apt-get install -y python3-pip make
1716
- name: Set up Python
1817
uses: actions/setup-python@v5
1918
with:
20-
python-version: 3.12
19+
python-version: "3.10"
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v5
22+
with:
23+
enable-cache: true
2124
- name: Install dependencies
2225
run: |
23-
python3 -m venv venv
24-
venv/bin/pip install --upgrade pip
25-
venv/bin/pip install ".[doc,cli]"
26+
uv venv
27+
uv pip install ".[doc,cli]"
2628
- name: Run doc
27-
run: venv/bin/sphinx-build -N -bhtml doc/ doc/_build -W
29+
run: uv run sphinx-build -N -bhtml doc/ doc/_build -W

.github/workflows/linux-build-test-amd64.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
branches: [master]
55
pull_request:
66
branches: [master]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
710
jobs:
811
linux-build-amd64:
912
name: Build wheel for linux AMD64
@@ -27,7 +30,7 @@ jobs:
2730
- name: Upload artifacts
2831
uses: actions/upload-artifact@v4
2932
with:
30-
name: dist
33+
name: dist-linux-amd64
3134
path: dist/*.whl
3235

3336

@@ -39,7 +42,7 @@ jobs:
3942
strategy:
4043
matrix:
4144
os: ["ubuntu-24.04", "ubuntu-22.04"]
42-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
45+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
4346
steps:
4447
- name: Checkout
4548
uses: actions/checkout@v4
@@ -49,20 +52,26 @@ jobs:
4952
with:
5053
python-version: ${{ matrix.python-version }}
5154

55+
- name: Install uv
56+
uses: astral-sh/setup-uv@v5
57+
with:
58+
enable-cache: true
59+
5260
- name: Download artifacts
5361
uses: actions/download-artifact@v4
5462
with:
55-
name: dist
63+
name: dist-linux-amd64
5664
path: dist
5765

5866
- name: Install python-snap7
5967
run: |
60-
python3 -m venv venv
61-
venv/bin/pip install --upgrade pip
62-
venv/bin/pip install pytest
63-
venv/bin/pip install dist/*.whl
68+
uv venv
69+
uv pip install pytest
70+
uv pip install dist/*.whl
6471
72+
# Use --no-project to prevent uv from syncing pyproject.toml,
73+
# which would rebuild from source and lose the bundled snap7 library.
6574
- name: Run tests
6675
run: |
67-
venv/bin/pytest -m "server or util or client or mainloop"
68-
sudo venv/bin/pytest -m partner
76+
uv run --no-project pytest -m "server or util or client or mainloop"
77+
sudo .venv/bin/pytest -m partner

.github/workflows/linux-build-test-arm64.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
branches: [master]
55
pull_request:
66
branches: [master]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
710
jobs:
811
linux-build-arm64:
912
name: Build wheel for linux arm64
@@ -32,7 +35,7 @@ jobs:
3235
- name: Upload artifacts
3336
uses: actions/upload-artifact@v4
3437
with:
35-
name: dist
38+
name: dist-linux-arm64
3639
path: dist/*.whl
3740

3841
linux-test-arm64:
@@ -41,15 +44,15 @@ jobs:
4144
runs-on: ubuntu-22.04
4245
strategy:
4346
matrix:
44-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
47+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
4548
steps:
4649
- name: Checkout
4750
uses: actions/checkout@v4
4851

4952
- name: Download artifacts
5053
uses: actions/download-artifact@v4
5154
with:
52-
name: dist
55+
name: dist-linux-arm64
5356
path: dist
5457

5558
- name: Set up QEMU
@@ -64,9 +67,10 @@ jobs:
6467
-v $PWD/dist:/dist \
6568
--platform linux/arm64 \
6669
"arm64v8/python:${{ matrix.python-version }}-bookworm" /bin/bash -s <<EOF
67-
python3 -m venv venv
68-
venv/bin/pip install --upgrade pip
69-
venv/bin/pip install pytest
70-
venv/bin/pip install dist/*.whl
71-
venv/bin/pytest -m "server or util or client or mainloop or partner"
70+
pip install --upgrade pip uv
71+
uv venv
72+
uv pip install pytest
73+
uv pip install dist/*.whl
74+
# Use --no-project to prevent uv from rebuilding from source
75+
uv run --no-project pytest -m "server or util or client or mainloop or partner"
7276
EOF

.github/workflows/linux-test-with-deb.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ on:
44
branches: [master]
55
pull_request:
66
branches: [master]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
710
jobs:
811
build:
912
strategy:
1013
matrix:
11-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
14+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1215
runs-on: ["ubuntu-22.04", "ubuntu-24.04"]
1316
runs-on: ${{ matrix.runs-on }}
1417
steps:
@@ -21,17 +24,19 @@ jobs:
2124
sudo add-apt-repository -y ppa:gijzelaar/snap7
2225
sudo apt-get update -qq
2326
sudo apt-get install -y libsnap7-dev libsnap7-1
24-
- uses: actions/checkout@v4
2527
- name: Set up Python ${{ matrix.python-version }}
2628
uses: actions/setup-python@v5
2729
with:
2830
python-version: ${{ matrix.python-version }}
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v5
33+
with:
34+
enable-cache: true
2935
- name: Install dependencies
3036
run: |
31-
python3 -m venv venv
32-
venv/bin/pip install --upgrade pip
33-
venv/bin/pip install ".[test]"
37+
uv venv
38+
uv pip install ".[test]"
3439
- name: Run pytest
3540
run: |
36-
venv/bin/pytest -m "server or util or client or mainloop"
37-
sudo venv/bin/pytest -m partner
41+
.venv/bin/pytest -m "server or util or client or mainloop"
42+
sudo .venv/bin/pytest -m partner

.github/workflows/mypy.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/osx-build-test-amd64.yml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ on:
44
branches: [master]
55
pull_request:
66
branches: [master]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
710
jobs:
811

912

1013
osx-build:
1114
name: Build wheel for OSX
12-
runs-on: macos-13
15+
runs-on: macos-14
1316
steps:
1417
- name: Checkout
1518
uses: actions/checkout@v4
@@ -20,14 +23,16 @@ jobs:
2023
- name: Prepare files
2124
run: |
2225
cp .github/build_scripts/arm64_osx.mk snap7-full-1.4.2/build/osx/
26+
cp .github/build_scripts/x86_64_osx.mk snap7-full-1.4.2/build/osx/
2327
pushd snap7-full-1.4.2/build/osx/
2428
make -f x86_64_osx.mk all
2529
make -f arm64_osx.mk all
26-
lipo -create -output /usr/local/lib/libsnap7.dylib ../bin/x86_64-osx/libsnap7.dylib ../bin/arm64-osx/libsnap7.dylib
27-
install_name_tool -id /usr/local/lib/libsnap7.dylib /usr/local/lib/libsnap7.dylib
30+
mkdir -p snap7/lib/
31+
lipo -create -output snap7/lib/libsnap7.dylib ../bin/x86_64-osx/libsnap7.dylib ../bin/arm64-osx/libsnap7.dylib
32+
install_name_tool -id @rpath/libsnap7.dylib snap7/lib/libsnap7.dylib
2833
popd
2934
mkdir -p snap7/lib/
30-
cp /usr/local/lib/libsnap7.dylib snap7/lib/
35+
cp snap7-full-1.4.2/build/osx/snap7/lib/libsnap7.dylib snap7/lib/
3136
3237
- name: Build wheel
3338
run: |
@@ -36,7 +41,7 @@ jobs:
3641
- name: Upload artifacts
3742
uses: actions/upload-artifact@v4
3843
with:
39-
name: dist
44+
name: dist-osx-universal
4045
path: dist/*.whl
4146

4247

@@ -46,8 +51,8 @@ jobs:
4651
runs-on: ${{ matrix.os }}
4752
strategy:
4853
matrix:
49-
os: ["macos-13", "macos-14", "macos-15"]
50-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
54+
os: ["macos-14", "macos-15"]
55+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
5156

5257
steps:
5358
- name: Checkout
@@ -58,20 +63,26 @@ jobs:
5863
with:
5964
python-version: ${{ matrix.python-version }}
6065

66+
- name: Install uv
67+
uses: astral-sh/setup-uv@v5
68+
with:
69+
enable-cache: true
70+
6171
- name: Download artifacts
6272
uses: actions/download-artifact@v4
6373
with:
64-
name: dist
74+
name: dist-osx-universal
6575
path: dist
6676

6777
- name: Install python-snap7
6878
run: |
69-
python3 -m venv venv
70-
venv/bin/pip install --upgrade pip
71-
venv/bin/pip install pytest
72-
venv/bin/pip install dist/*.whl
79+
uv venv
80+
uv pip install pytest
81+
uv pip install dist/*.whl
7382
83+
# Use --no-project to prevent uv from syncing pyproject.toml,
84+
# which would rebuild from source and lose the bundled snap7 library.
7485
- name: Run tests
7586
run: |
76-
venv/bin/pytest -m "server or util or client or mainloop"
77-
sudo venv/bin/pytest -m partner
87+
uv run --no-project pytest -m "server or util or client or mainloop"
88+
sudo .venv/bin/pytest -m partner

.github/workflows/osx-test-with-brew.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,31 @@ on:
44
branches: [master]
55
pull_request:
66
branches: [master]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
710
jobs:
811
osx_wheel:
912
strategy:
1013
matrix:
11-
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
12-
runs-on: ["macos-13", "macos-14", "macos-15"]
14+
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
15+
runs-on: ["macos-14", "macos-15"]
1316

1417
runs-on: ${{ matrix.runs-on }}
1518
steps:
1619
- name: Checkout
1720
uses: actions/checkout@v4
1821
- name: Install snap7
1922
run: brew install --overwrite snap7 python@${{ matrix.python-version }}
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v5
25+
with:
26+
enable-cache: true
2027
- name: Install python-snap7
2128
run: |
22-
python${{ matrix.python-version }} -m venv venv
23-
venv/bin/python3 -m pip install --upgrade pip setuptools
24-
venv/bin/python3 -m pip install -e .[test]
29+
uv venv --python python${{ matrix.python-version }}
30+
uv pip install -e ".[test]"
2531
- name: Run pytest
2632
run: |
27-
venv/bin/pytest -m "server or util or client or mainloop"
28-
sudo venv/bin/pytest -m partner
33+
uv run pytest -m "server or util or client or mainloop"
34+
sudo uv run pytest -m partner

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
branches: [master]
55
pull_request:
66
branches: [master]
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
710
jobs:
811
pre-commit:
912
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)