Skip to content

Commit

Permalink
feat: extend wheel generation to include cp 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
kelsos committed Oct 25, 2024
1 parent b25484e commit 19a01a2
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ on:

env:
LIB_VERSION: '2024.1.2'
PYTHON_VERSION: '3.11.7'
PYTHON_VERSION: '3.11.9'
CIBW_VERSION: '2.21.3'
CIBW_BUILD: 'cp311-*'
CIBW_BUILD: 'cp311-* cp312-*'
CIBW_SKIP: '*-musllinux_*'
CIBW_BUILD_VERBOSITY: 1

Expand Down Expand Up @@ -94,6 +94,7 @@ jobs:
name: 'Build wheels for macOS'
runs-on: macos-13
strategy:
fail-fast: false
matrix:
arch: [arm64, x86_64, universal2]
needs: [build_macos_openssl_universal2]
Expand All @@ -119,7 +120,7 @@ jobs:
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
CIBW_BEFORE_BUILD_MACOS: ./build.sh
CIBW_BEFORE_ALL_MACOS: ./build.sh
- uses: actions/upload-artifact@v4
with:
name: pypi-wheels-macos-${{ matrix.arch }}
Expand All @@ -129,6 +130,7 @@ jobs:
name: 'Build wheels for Linux'
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
arch: [ aarch64, native ]
steps:
Expand All @@ -153,7 +155,7 @@ jobs:
working-directory: build
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_BUILD_LINUX: ./build.sh
CIBW_BEFORE_ALL_LINUX: ./build.sh
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
- uses: actions/upload-artifact@v4
with:
Expand All @@ -180,7 +182,7 @@ jobs:
working-directory: build
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_BUILD: Powershell.exe -F ./build.ps1
CIBW_BEFORE_ALL_WINDOWS: Powershell.exe -F ./build.ps1
CIBW_ARCHS_WINDOWS: "native"
- name: clean openssl conf
shell: pwsh
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![PyPI - Version](https://img.shields.io/pypi/v/rotki-pysqlcipher3)
![SQLCipher - Version](https://img.shields.io/badge/SQLCipher-v4.5.3-green)
![SQLite - Version](https://img.shields.io/badge/SQLite-3.39.4-green)
![OpenSSL - Version](https://img.shields.io/badge/OpenSSL-1.1.1w-green)
![OpenSSL - Version](https://img.shields.io/badge/OpenSSL-3.0.15-green)



Expand Down
4 changes: 2 additions & 2 deletions scripts/linux/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ cd "$WORKDIR/sqlcipher" || exit 1
--enable-tempstore=yes \
--disable-shared \
--enable-static=yes \
--with-crypto-lib=none > /dev/null
--with-crypto-lib=none > /dev/null || exit 1

make sqlite3.c > /dev/null
make sqlite3.c > /dev/null || exit 1

echo "✔ SQLCipher amalgamation created"

Expand Down
4 changes: 2 additions & 2 deletions scripts/linux/local-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ echo activating venv-ci
source /tmp/.venv-ci/bin/activate
pip install cibuildwheel==2.21.3

export CIBW_BEFORE_BUILD='./build.sh'
export CIBW_BUILD='cp311-*'
export CIBW_BEFORE_ALL='./build.sh'
export CIBW_BUILD='cp311-* cp312-*'
export CIBW_SKIP='*-musllinux_*'
export CIBW_ARCHS='native'
export CIBW_BUILD_VERBOSITY=1
Expand Down
8 changes: 4 additions & 4 deletions scripts/mac/build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash

WORKDIR=$PWD
ARCH_POSTFIX=$(echo $_PYTHON_HOST_PLATFORM | sed -En 's/macosx-..\..-(.*)/\1/p')
ARCH_POSTFIX=${CIBW_ARCHS_MACOS}

echo "Copying OpenSSL ${ARCH_POSTFIX} to openssl/"
cp -R "openssl-macos-$ARCH_POSTFIX" openssl/
cp -R "openssl-macos-$ARCH_POSTFIX" openssl/ || exit 1

cd "sqlcipher" || exit 1

Expand All @@ -16,9 +16,9 @@ echo "Creating SQLCipher amalgamation"
--enable-static=yes \
--with-crypto-lib=none \
CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -I$WORKDIR/openssl/include" \
LDFLAGS="$WORKDIR/openssl/lib/libcrypto.a" > /dev/null
LDFLAGS="$WORKDIR/openssl/lib/libcrypto.a" > /dev/null || exit 1

make sqlite3.c > /dev/null
make sqlite3.c > /dev/null || exit 1

if [[ ! -d "$WORKDIR/amalgamation" ]]; then
mkdir -p "$WORKDIR/amalgamation"
Expand Down
2 changes: 1 addition & 1 deletion scripts/mac/local-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ echo activating venv-ci
source /tmp/.venv-ci/bin/activate
pip3 install cibuildwheel==2.21.3

export CIBW_BEFORE_BUILD='./build.sh'
export CIBW_BEFORE_ALL='./build.sh'
export CIBW_BUILD='cp311-*'
export CIBW_SKIP='*-musllinux_*'
export CIBW_ARCHS='native'
Expand Down
2 changes: 1 addition & 1 deletion scripts/win/local-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ echo "Activating .venv-ci"
pip install cibuildwheel==2.21.3
ExitOnFailure("Failed to activate rotki VirtualEnv")

$env:CIBW_BEFORE_BUILD = 'PowerShell.exe -File .\build.ps1'
$env:CIBW_BEFORE_ALL = 'PowerShell.exe -File .\build.ps1'
$env:CIBW_BUILD = 'cp311-*'
$env:CIBW_ARCHS = 'native'
$env:CIBW_BUILD_VERBOSITY = 1
Expand Down

0 comments on commit 19a01a2

Please sign in to comment.