Skip to content

Commit

Permalink
fix builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Денис Петров committed May 1, 2024
1 parent d51b193 commit 34f491f
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
8 changes: 7 additions & 1 deletion .github/actions/prepare_snap7/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@ runs:

- name: Update wheel
shell: bash
run: python3 -m pip install --upgrade pip wheel build
if: ${{ runner.os != 'macOS' }}
run: python3 -m pip install --upgrade pip wheel build setuptools

- name: Update wheel
shell: bash
if: ${{ runner.os == 'macOS' }}
run: python3 -m pip install --upgrade pip wheel build setuptools --break-system-packages
6 changes: 3 additions & 3 deletions .github/build_scripts/build_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ make -f "${INPUT_MAKEFILE}" install
popd
mkdir -p snap7/lib/
cp /usr/lib/libsnap7.so snap7/lib/
${INPUT_PYTHON} -m pip install wheel build auditwheel patchelf
${INPUT_PYTHON} -m build . --wheel -C="--build-option=--plat-name=${INPUT_PLATFORM}"
${INPUT_PYTHON} -m pip install --upgrade pip wheel build auditwheel patchelf setuptools
${INPUT_PYTHON} -m build . --wheel -C="--plat-name=${INPUT_PLATFORM}"

auditwheel repair dist/*${INPUT_PLATFORM}.whl --plat ${INPUT_PLATFORM} -w ${INPUT_WHEELDIR}
auditwheel repair dist/*.whl --plat ${INPUT_PLATFORM} -w ${INPUT_WHEELDIR}
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
docker run --rm --interactive -v $PWD/tests:/tests \
-v $PWD/pyproject.toml:/pyproject.toml \
-v $PWD/wheelhouse:/wheelhouse \
"arm64v8/python:${{ matrix.python-version }}-bullseye" /bin/bash -s <<EOF
"arm64v8/python:${{ matrix.python-version }}-bookworm" /bin/bash -s <<EOF
python3 -m pip install $(ls wheelhouse/*_aarch64.whl)
python3 -m pip install pytest
python -m pytest tests/ -m "server or util or client or mainloop or partner"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: |
mkdir -p snap7/lib/
Copy-Item .\snap7-full-1.4.2\release\Windows\Win64\snap7.dll .\snap7\lib
python3 -m build . --wheel -C="--build-option=--plat-name=win_amd64"
python3 -m build . --wheel -C="--plat-name=win_amd64"
mkdir -p wheelhouse/${{ runner.os }}/
cp dist/*.whl wheelhouse/${{ runner.os }}/
Expand All @@ -56,7 +56,7 @@ jobs:

osx-build:
name: Build wheel for osx
runs-on: macos-14
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -78,7 +78,7 @@ jobs:
- name: Build wheel
run: |
python3 -m build . --wheel -C="--build-option=--plat-name=macosx_10_9_universal2"
python3 -m build . --wheel -C="--plat-name=macosx_10_9_universal2"
mkdir -p wheelhouse/${{ runner.os }}/
cp dist/*.whl wheelhouse/${{ runner.os }}/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
- name: make a virtualenv
run: python3 -m venv venv && source venv/bin/activate
- name: Upgrade pip
run: python3 -m pip install --upgrade pip
run: python3 -m pip install --upgrade pip setuptools --break-system-packages
- name: Install python-snap7
run: python3 -m pip install .[test]
run: python3 -m pip install -e .[test] --break-system-packages
- name: Run pytest
run: |
pytest -m "server or util or client or mainloop"
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
graft lib
include README.rst
4 changes: 2 additions & 2 deletions snap7/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ def __init__(self, lib_location: Optional[str] = None):
)
if not self.lib_location:
error = f"""can't find snap7 shared library.
This probably means you are installing python-snap7 from source. When no binary wheel is found for you architecture, pip
install falls back on a source install. For this to work, you need to manually install the snap7 library, which python-snap7
uses under the hood.
The shortest path to success is to try to get a binary wheel working. Probably you are running on an unsupported
platform or python version. You are running:
machine: {platform.machine()}
machine: {platform.machine()}
system: {platform.system()}
python version: {platform.python_version()}
"""
Expand Down

0 comments on commit 34f491f

Please sign in to comment.