Skip to content

Commit 49a35e5

Browse files
committed
cherry pick python build fixes and fix wheels to build for Apple Silicon
1 parent a9dacd8 commit 49a35e5

5 files changed

Lines changed: 35 additions & 17 deletions

File tree

.github/workflows/build_cmake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ jobs:
5555
with:
5656
python-version: '3.8' # 3.x grabs latest minor version of python3, but 3.9 not fully supported yet
5757
- name: Install Python dependencies
58-
run: python -m pip install --upgrade pip setuptools wheel numpy tox pytest
58+
run: python -m pip install --upgrade pip setuptools wheel tox
5959
- name: Build and run Python tests
6060
run: python -m tox

.github/workflows/build_wheels.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,36 @@ jobs:
3737
name: ${{ matrix.config.name }}
3838
runs-on: ${{ matrix.config.os }}
3939
strategy:
40-
fail-fast: false
40+
#fail-fast: false
4141
matrix:
4242
config:
4343
- {
44-
name: "MacOS 10.15",
45-
os: macos-latest
44+
name: "MacOS Latest (Intel)",
45+
os: macos-latest,
46+
cibw-arch: macosx_x86_64
4647
}
4748
- {
48-
name: "Ubuntu Latest",
49-
os: ubuntu-latest
49+
name: "MacOS Latest (Apple Silicon)",
50+
os: macos-latest,
51+
cibw-arch: macosx_arm64
52+
}
53+
- {
54+
name: "Ubuntu Latest (x86_64)",
55+
os: ubuntu-latest,
56+
cibw-arch: manylinux_x86_64
57+
}
58+
- {
59+
name: "Ubuntu Latest (i686)",
60+
os: ubuntu-latest,
61+
cibw-arch: manylinux_i686
5062
}
5163
- {
5264
name: "Windows Latest",
53-
os: windows-latest
65+
os: windows-latest,
66+
cibw-arch: win_amd64
5467
}
55-
68+
69+
5670
steps:
5771
- name: Checkout
5872
uses: actions/checkout@v3
@@ -65,12 +79,20 @@ jobs:
6579
- name: Install Python dependencies
6680
run: python -m pip install cibuildwheel==2.5.0
6781

82+
- name: Configure cibuildwheel
83+
shell: bash
84+
run: |
85+
CMAKE_OSX_ARCHITECTURES=${{ matrix.config.cibw-arch == 'macosx_x86_64' && 'x86_64' || matrix.config.cibw-arch == 'macosx_arm64' && 'arm64' || matrix.config.cibw-arch == 'macosx_universal2' && '"arm64;x86_64"' || '' }}
86+
echo "CIBW_ARCHS_MACOS=x86_64 arm64" >> $GITHUB_ENV
87+
echo "CIBW_BUILD=*-${{ matrix.config.cibw-arch }}" >> $GITHUB_ENV
88+
echo "CIBW_ENVIRONMENT_MACOS=CMAKE_OSX_ARCHITECTURES=\"$CMAKE_OSX_ARCHITECTURES\"" >> $GITHUB_ENV
89+
6890
- name: Build wheels
6991
run: python -m cibuildwheel --output-dir dist
7092
env:
71-
CIBW_BEFORE_BUILD: python -m pip install cmake>=3.18
93+
CIBW_BEFORE_BUILD_LINUX: "yum remove -y cmake"
94+
CIBW_BEFORE_BUILD: "python -m pip install cmake>=3.18"
7295
CIBW_SKIP: "*-win32 pp*-macosx*"
73-
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2"
7496

7597
- uses: actions/upload-artifact@v2
7698
with:

MANIFEST.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ global-include *.bin
77

88
global-exclude .git*
99

10-
recursive-include python/pybind11 *
11-
1210
graft cmake
1311
graft common
1412
graft cpc

common/test/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ target_include_directories(common_test
4545

4646
target_sources(common_test
4747
INTERFACE
48-
#${CMAKE_CURRENT_SOURCE_DIR}/catch.hpp
4948
${CMAKE_CURRENT_SOURCE_DIR}/test_allocator.hpp
5049
${CMAKE_CURRENT_SOURCE_DIR}/test_type.hpp
5150
PRIVATE
@@ -71,4 +70,4 @@ add_test(
7170
target_sources(integration_test
7271
PRIVATE
7372
integration_test.cpp
74-
)
73+
)

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import os
2222
import sys
23-
import sysconfig
2423
import platform
2524
import subprocess
2625

@@ -81,15 +80,15 @@ def build_extension(self, ext):
8180

8281
setup(
8382
name='datasketches',
84-
version='3.5.0',
83+
version='3.5.1',
8584
author='Apache Software Foundation',
8685
author_email='dev@datasketches.apache.org',
8786
description='The Apache DataSketches Library for Python',
8887
license='Apache License 2.0',
8988
url='http://datasketches.apache.org',
9089
long_description=open('python/README.md').read(),
9190
long_description_content_type='text/markdown',
92-
packages=find_packages('python'), # python pacakges only in this dir
91+
packages=find_packages(where='python',exclude=['src','*tests*']), # src not needed if only the.so
9392
package_dir={'':'python'},
9493
# may need to add all source paths for sdist packages w/o MANIFEST.in
9594
ext_modules=[CMakeExtension('datasketches')],

0 commit comments

Comments
 (0)