|
1 | 1 | [build-system] |
2 | | -requires = ["setuptools", "wheel", "cython", "pkgconfig"] |
| 2 | +requires = ["setuptools", "wheel", "cython", "pkgconfig", "setuptools-scm"] |
3 | 3 | build-backend = "setuptools.build_meta" |
| 4 | + |
| 5 | +[tool.cibuildwheel] |
| 6 | +build-frontend = "build" |
| 7 | +build = "cp3*" |
| 8 | +skip = ["*-win32", "*-manylinux_i686", "*-musllinux_*"] |
| 9 | +archs = ["auto64"] |
| 10 | +test-requires = ['.[test] pytest'] |
| 11 | +test-command = ['pytest --pyargs rocksdb'] |
| 12 | + |
| 13 | +manylinux-x86_64-image = "manylinux2014" |
| 14 | + |
| 15 | +environment = {ROCKSDB_VER="v6.14.6", LIBROCKSDB_PATH="/opt/rocksdb-$ROCKSDB_VER"} |
| 16 | + |
| 17 | +[tool.cibuildwheel.linux] |
| 18 | +# Avoid re-building the C library in every iteration by testing for the build directory. |
| 19 | +before-build = "yum install -y bzip2-devel lz4-devel snappy-devel zlib-devel python3-Cython && (test -d $LIBROCKSDB_PATH || ( git clone https://github.com/facebook/rocksdb --depth 1 --branch $ROCKSDB_VER $LIBROCKSDB_PATH && cd $LIBROCKSDB_PATH && CXXFLAGS='-flto -Os -s' PORTABLE=1 make shared_lib -j 4 )) && pushd $LIBROCKSDB_PATH && make install-shared && ldconfig && popd" |
| 20 | + |
| 21 | +[tool.cibuildwheel.macos] |
| 22 | +environment = {ROCKSDB_VER="v6.14.6", LIBROCKSDB_PATH="/usr/local/opt/rocksdb-$ROCKSDB_VER", REPAIR_LIBRARY_PATH="$LIBROCKS_DB_PATH"} |
| 23 | +before-build = [ |
| 24 | + "brew install bzip2 lz4 snappy zlib cython git", |
| 25 | + 'export LDFLAGS="-L/usr/local/opt/bzip2/lib"', |
| 26 | + 'export CPPFLAGS="-I/usr/local/opt/bzip2/include"', |
| 27 | + "(test -d $LIBROCKSDB_PATH || ( git clone https://github.com/facebook/rocksdb --depth 1 --branch $ROCKSDB_VER $LIBROCKSDB_PATH && cd $LIBROCKSDB_PATH && CXXFLAGS='-flto -Os' PORTABLE=1 make shared_lib -j 4 )) && pushd $LIBROCKSDB_PATH && make install-shared && update_dyld_shared_cache && popd", |
| 28 | + "otool -L librocksdb.6.14.dylib", |
| 29 | +] |
| 30 | +repair-wheel-command = """\ |
| 31 | +DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-listdeps {wheel} && |
| 32 | +DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-wheel \ |
| 33 | +--require-archs {delocate_archs} -w {dest_dir} -v {wheel}\ |
| 34 | +""" |
| 35 | + |
| 36 | +[tool.cibuildwheel.windows] |
| 37 | +before-build = [ |
| 38 | + "vcpkg install zlib:x64-windows", |
| 39 | + "vcpkg install bzip2:x64-windows", |
| 40 | + "vcpkg install lz4:x64-windows", |
| 41 | + "vcpkg install snappy:x64-windows", |
| 42 | + "vcpkg install rocksdb[bzip2,zlib,lz4,snappy]:x64-windows --recurse", |
| 43 | + 'echo $(python --version) && python -m pip install cython && python -m cython -3 --cplus --fast-fail --annotate rocksdb/_rocksdb.pyx && python ./setup.py build_ext --include-dirs=$(VCPKG_ROCKSDB_INCLUDE_PATH) --library-dirs=$(VCPKG_ROCKSDB_LIB_PATH) --libraries"=shlwapi rpcrt4"', |
| 44 | +] |
| 45 | + |
| 46 | +[tool.cibuildwheel.windows.environment] |
| 47 | +VCPKG_ROCKSDB_INCLUDE_PATH= "C:\\vcpkg\\installed\\x64-windows\\include\\" |
| 48 | +VCPKG_ROCKSDB_LIB_PATH= "C:\\vcpkg\\installed\\x64-windows\\lib\\" |
| 49 | +vcpkgVersion= "2020.06.15" |
| 50 | +vcpkgInstallParamPath= '$(Build.SourcesDirectory)\\.azure-pipelines\\vcpkg' |
| 51 | +vcpkgBinariesPath= 'C:\\Users\\VssAdministrator\\AppData\\Local\\vcpkg\\archives' |
| 52 | +"vcpkg.arch"= 'x64' |
0 commit comments