Skip to content

Commit 36996c2

Browse files
authored
Fix #451 (#453)
1 parent b5ff3d7 commit 36996c2

23 files changed

+276
-280
lines changed
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM ghcr.io/nikteliy/manylinux_2_24_armv7l:python3.7
2+
3+
COPY entrypoint.sh /entrypoint.sh
4+
RUN chmod +x /entrypoint.sh
5+
6+
ENTRYPOINT ["/entrypoint.sh"]
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: 'linux_armv7l'
2+
description: 'Builds linux_armv7l package'
3+
inputs:
4+
script:
5+
description: 'Specifies the path to the build script'
6+
required: true
7+
platform:
8+
description: 'Specifies the --plat-name option to the build command'
9+
required: true
10+
makefile:
11+
description: 'Specifies the path to the .mk file'
12+
required: true
13+
python:
14+
description: 'Specifies the path to the python interpreter'
15+
default: /usr/bin/python3
16+
wheeldir:
17+
description: 'Specifies directory to store delocated wheels'
18+
required: true
19+
default: wheelhouse
20+
runs:
21+
using: 'docker'
22+
image: 'Dockerfile'
23+
args:
24+
- ${{ inputs.script }}
25+
- ${{ inputs.platform }}
26+
- ${{ inputs.makefile }}
27+
- ${{ inputs.python }}
28+
- ${{ inputs.wheeldir }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -o errexit
4+
set -o pipefail
5+
set -o nounset
6+
7+
exec "$INPUT_SCRIPT"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM quay.io/pypa/manylinux_2_24_aarch64:latest
2+
3+
COPY entrypoint.sh /entrypoint.sh
4+
RUN chmod +x /entrypoint.sh
5+
6+
ENTRYPOINT ["/entrypoint.sh"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: 'manylinux_2_24_aarch64'
2+
description: 'Builds manylinux_2_24_aarch64 package'
3+
inputs:
4+
script:
5+
description: 'Specifies the path to the build script'
6+
required: true
7+
platform:
8+
description: 'Specifies the --plat-name option to the build command'
9+
required: true
10+
makefile:
11+
description: 'Specifies the path to the .mk file'
12+
required: true
13+
python:
14+
description: 'Specifies the path to the python interpreter'
15+
default: /usr/bin/python3
16+
wheeldir:
17+
description: 'Specifies directory to store delocated wheels'
18+
required: true
19+
default: wheelhouse
20+
runs:
21+
using: 'docker'
22+
image: 'Dockerfile'
23+
args:
24+
- ${{ inputs.script }}
25+
- ${{ inputs.platform }}
26+
- ${{ inputs.makefile }}
27+
- ${{ inputs.python }}
28+
- ${{ inputs.wheeldir }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -o errexit
4+
set -o pipefail
5+
set -o nounset
6+
7+
exec "$INPUT_SCRIPT"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM quay.io/pypa/manylinux_2_24_x86_64:latest
2+
3+
COPY /entrypoint.sh /entrypoint.sh
4+
RUN chmod +x /entrypoint.sh
5+
6+
ENTRYPOINT ["/entrypoint.sh"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: 'manylinux_2_24_x86_64'
2+
description: 'Builds manylinux_2_24_x86_64 package'
3+
inputs:
4+
script:
5+
description: 'Specifies the path to the build script'
6+
required: true
7+
platform:
8+
description: 'Specifies the --plat-name option to the build command'
9+
required: true
10+
makefile:
11+
description: 'Specifies the path to the .mk file'
12+
required: true
13+
python:
14+
description: 'Specifies the path to the python interpreter'
15+
default: /usr/bin/python3
16+
wheeldir:
17+
description: 'Specifies directory to store delocated wheels'
18+
required: true
19+
default: wheelhouse
20+
runs:
21+
using: 'docker'
22+
image: 'Dockerfile'
23+
args:
24+
- ${{ inputs.script }}
25+
- ${{ inputs.platform }}
26+
- ${{ inputs.makefile }}
27+
- ${{ inputs.python }}
28+
- ${{ inputs.wheeldir }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -o errexit
4+
set -o pipefail
5+
set -o nounset
6+
7+
exec "$INPUT_SCRIPT"

.github/actions/prepare_snap7/action.yml

+1-8
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ runs:
2929
shell: bash
3030
run: 7z x snap7-full-1.4.2.7z
3131

32-
- name: Copy files
33-
shell: bash
34-
run: |
35-
mkdir src
36-
cp snap7-full-1.4.2/release/Wrappers/c-cpp/snap7.h src
37-
cp .github/build_scripts/dummy.c ./
38-
3932
- name: Update wheel
4033
shell: bash
41-
run: python -m pip install --upgrade pip wheel
34+
run: python3 -m pip install --upgrade pip wheel build
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
cp .github/build_scripts/aarch64-linux-gnu.mk snap7-full-1.4.2/build/unix/
4+
pushd snap7-full-1.4.2/build/unix/
5+
make -f "${INPUT_MAKEFILE}" install
6+
popd
7+
mkdir -p snap7/lib/
8+
cp /usr/lib/libsnap7.so snap7/lib/
9+
${INPUT_PYTHON} -m pip install wheel build auditwheel patchelf
10+
${INPUT_PYTHON} -m build . --wheel -C="--build-option=--plat-name=${INPUT_PLATFORM}"
11+
12+
auditwheel repair dist/*${INPUT_PLATFORM}.whl --plat ${INPUT_PLATFORM} -w ${INPUT_WHEELDIR}
13+

.github/build_scripts/dummy.c

-1
This file was deleted.

.github/build_scripts/repack_wheel.sh

-62
This file was deleted.

.github/build_scripts/repack_wheel_windows.ps1

-15
This file was deleted.

.github/workflows/build-and-test-arm32v7.yml

+20-30
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,38 @@ on:
55
pull_request:
66
branches: [master]
77
jobs:
8-
arm32-build:
8+
linux-build-arm32v7:
99
name: Build arm32 wheel
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v3
1414

15-
- name: prepare snap7 archive
15+
- name: Prepare snap7 archive
1616
uses: ./.github/actions/prepare_snap7
1717

1818
- name: Set up QEMU
1919
uses: docker/setup-qemu-action@v2
2020
with:
2121
platforms: arm
22-
23-
- name: Build libsnap7.so
24-
run: |
25-
docker run --rm --interactive -v $PWD/snap7-full-1.4.2:/snap7-full-1.4.2 "arm32v7/gcc:latest" /bin/bash -s <<EOF
26-
cd snap7-full-1.4.2/build/unix/
27-
make -f arm_v7_linux.mk all
28-
EOF
29-
30-
- name: Build pure python wheel
31-
run: python3 setup.py bdist_wheel --plat-name=linux_armv7l
32-
33-
- name: Repack wheel
34-
run: |
35-
unpack_tmp_dir=unpack_tmp_dir
36-
mkdir -p $unpack_tmp_dir
37-
packagename=$(python3 -m wheel unpack $(ls dist/*linux_armv7l.whl) -d $unpack_tmp_dir | sed -e 's/.*\/\(.*\)...OK/\1/')
38-
echo $packagename
39-
mkdir -p $unpack_tmp_dir/$packagename/snap7/lib
40-
cp snap7-full-1.4.2/build/bin/arm_v7-linux/libsnap7.so $unpack_tmp_dir/$packagename/snap7/lib/
41-
mkdir -p wheelhouse/linux_armv7l
42-
python3 -m wheel pack $unpack_tmp_dir/$packagename -d wheelhouse/linux_armv7l/
22+
23+
- name: Build wheel
24+
uses: ./.github/actions/linux_armv7l
25+
with:
26+
script: ./.github/build_scripts/build_package.sh
27+
platform: manylinux_2_24_armv7l
28+
makefile: arm_v7_linux.mk
29+
python: /usr/local/bin/python3
4330

4431
- name: Upload artifacts
4532
uses: actions/upload-artifact@v3
4633
with:
4734
name: wheels
48-
path: wheelhouse/*/*.whl
35+
path: wheelhouse/*.whl
4936

50-
test-wheel:
37+
test-wheels-arm32:
5138
name: Testing wheel
52-
needs: arm32-build
39+
needs: linux-build-arm32v7
5340
runs-on: ubuntu-latest
5441
strategy:
5542
matrix:
@@ -68,11 +55,14 @@ jobs:
6855
uses: docker/setup-qemu-action@v2
6956
with:
7057
platforms: arm
71-
58+
7259
- name: Run tests in docker:arm32v7
7360
run: |
74-
docker run --platform linux/arm/v7 --rm --interactive -v $PWD/tests:/tests -v $PWD/setup.cfg:/setup.cfg \
75-
-v $PWD/wheelhouse:/wheelhouse "arm32v7/python:${{ matrix.python-version }}-buster" /bin/bash -s <<EOF
76-
python -m pip install pytest pytest-asyncio $(ls wheelhouse/linux_armv7l/*.whl)
61+
docker run --platform linux/arm/v7 --rm --interactive -v $PWD/tests:/tests \
62+
-v $PWD/pyproject.toml:/pyproject.toml \
63+
-v $PWD/wheelhouse:/wheelhouse \
64+
"arm32v7/python:${{ matrix.python-version }}-buster" /bin/bash -s <<EOF
65+
python -m pip install pytest pytest-asyncio $(ls wheelhouse/*manylinux_2_24_armv7l.whl)
7766
python -m pytest tests/ -m "server or util or client or mainloop or partner"
7867
EOF
68+

0 commit comments

Comments
 (0)