Skip to content

Commit f7df390

Browse files
authored
ARROW-120 Support PyArrow 10.0 (#99)
* ARROW-120 Support PyArrow 10.0 * bump to c++17 * build with macos 11 and add changelog * update macos builds again * try a windows fix * fix macos deployment target again * set macos deployment target default in setup.py as well * address review * clarify
1 parent 51bfd16 commit f7df390

File tree

6 files changed

+23
-17
lines changed

6 files changed

+23
-17
lines changed

.github/workflows/release-python.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
# https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
2626
buildplat:
2727
- [ubuntu-20.04, manylinux_x86_64]
28-
- [macos-10.15, macosx_*]
28+
- [macos-11, macosx_*]
2929
- [windows-2019, win_amd64]
3030
python: ["cp37", "cp38", "cp39", "cp310"]
3131

@@ -41,17 +41,17 @@ jobs:
4141
run: python -m pip install "cibuildwheel>=2.4,<3"
4242

4343
- name: Build MacOS Py38 Wheel
44-
if: ${{ matrix.python == 'cp38' && matrix.buildplat[0] == 'macos-10.15' }}
44+
if: ${{ matrix.python == 'cp38' && matrix.buildplat[0] == 'macos-11' }}
4545
env:
4646
CIBW_BUILD: cp38-macosx_x86_64
47-
MACOSX_DEPLOYMENT_TARGET: "10.13"
47+
MACOSX_DEPLOYMENT_TARGET: "10.14"
4848
run: python -m cibuildwheel --output-dir wheelhouse
4949

5050
- name: Build wheels
51-
if: ${{ matrix.python != 'cp38' || matrix.buildplat[0] != 'macos-10.15' }}
51+
if: ${{ matrix.python != 'cp38' || matrix.buildplat[0] != 'macos-11' }}
5252
env:
5353
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
54-
MACOSX_DEPLOYMENT_TARGET: "10.13"
54+
MACOSX_DEPLOYMENT_TARGET: "10.14"
5555
run: python -m cibuildwheel --output-dir wheelhouse
5656

5757
- uses: actions/upload-artifact@v3

bindings/python/build-libbson.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ pushd "$WORKDIR"
4646
-DENABLE_MONGOC=OFF \
4747
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} \
4848
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
49-
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} \
49+
-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \
5050
-DCMAKE_INSTALL_PREFIX:PATH="$LIBBSON_INSTALL_DIR" \
5151
..
5252
else
5353
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF \
5454
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} \
5555
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
56-
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} \
56+
-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \
5757
-DENABLE_MONGOC=OFF \
5858
..
5959
fi

bindings/python/docs/source/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44
Changes in Version 0.6.0
55
------------------------
66
- Fixed ``ImportError`` on Windows by building ``libbson`` in "Release" mode.
7+
- Support PyArrow 10.0.
78

89
Changes in Version 0.5.1
910
------------------------

bindings/python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ requires = [
44
"wheel>=0.37",
55
"cython>=0.29",
66
# Must be kept in sync with the `install_requires` in `setup.cfg`
7-
"pyarrow>=9.0.0,<9.1.0",
7+
"pyarrow>=10.0.0,<10.1.0",
88
]
99

1010
[tool.cibuildwheel]

bindings/python/setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ packages = find:
3434
python_requires = >=3.7
3535
install_requires =
3636
# keep versions in sync with pyproject.toml "requires"
37-
pyarrow >=9,<9.1
37+
pyarrow >=10,<10.1
3838
pymongo >=3.11,<5
3939

4040
[options.package_data]

bindings/python/setup.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
# Whether to create libarrow symlinks on posix systems.
1919
CREATE_LIBARROW_SYMLINKS = os.environ.get("MONGO_CREATE_LIBARROW_SYMLINKS", "1")
2020

21+
# Set a default value for MACOSX_DEPLOYMENT_TARGET.
22+
os.environ.setdefault("MACOSX_DEPLOYMENT_TARGET", "10.15")
23+
2124

2225
def query_pkgconfig(cmd):
2326
status, output = subprocess.getstatusoutput(cmd)
@@ -147,14 +150,16 @@ def append_arrow_flags(ext):
147150
pa.create_library_symlinks()
148151

149152
if os.name == "posix":
150-
ext.extra_compile_args.append("-std=c++11")
151-
152-
# Arrow's manylinux{2010, 2014} binaries are built with gcc < 4.8 which predates CXX11 ABI
153-
# - https://uwekorn.com/2019/09/15/how-we-build-apache-arrows-manylinux-wheels.html
154-
# - https://arrow.apache.org/docs/python/extending.html#example
155-
if "std=" not in os.environ.get("CXXFLAGS", ""):
156-
ext.extra_compile_args.append("-std=c++11")
157-
ext.extra_compile_args.append("-D_GLIBCXX_USE_CXX11_ABI=0")
153+
ext.extra_compile_args.append("-std=c++17")
154+
155+
# Arrow's manylinux{2010, 2014} binaries are built with gcc < 4.8 which predates CXX11 ABI
156+
# - https://uwekorn.com/2019/09/15/how-we-build-apache-arrows-manylinux-wheels.html
157+
# - https://arrow.apache.org/docs/python/extending.html#example
158+
if "std=" not in os.environ.get("CXXFLAGS", ""):
159+
ext.extra_compile_args.append("-D_GLIBCXX_USE_CXX11_ABI=0")
160+
161+
elif os.name == "nt":
162+
ext.extra_compile_args.append("/std:c++17")
158163

159164

160165
def get_extension_modules():

0 commit comments

Comments
 (0)