diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index fa04501d..e4b5b3ae 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -11,84 +11,56 @@ jobs: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} env: - MACOSX_DEPLOYMENT_TARGET: "11.0" + MACOSX_DEPLOYMENT_TARGET: "10.15" strategy: matrix: - os: [ubuntu-latest, macos-11, windows-latest] - cibw_archs: ["auto"] + os: [ubuntu-20.04, macos-11, windows-latest] + cibw_archs: ["auto64"] + cibw_build: ["cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*"] steps: - - uses: actions/checkout@v2 - name: Check out + - uses: actions/checkout@v3 + name: Check out + - - uses: actions/setup-python@v3 + - uses: ilammy/msvc-dev-cmd@v1 + name: Add MSVS Path + + - uses: actions/setup-python@v4 name: Install Python with: python-version: '3.8' - + - name: Install cibuildwheel run: | - python -m pip install cibuildwheel delvewheel - - - name: Build wheels for CPython 3.10 - run: | - python -m cibuildwheel --output-dir dist - env: - CIBW_BUILD: "cp310-*" - CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010 - CIBW_MANYLINUX_I686_IMAGE: manylinux2010 - CIBW_BEFORE_BUILD_MACOS: brew install gcc@8 - CIBW_ARCHS_WINDOWS: "auto64" - CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" - CIBW_ARCHS: ${{ matrix.cibw_archs }} + python -m pip install cibuildwheel==2.12.1 delvewheel wheel - - name: Build wheels for CPython 3.9 - run: | - python -m cibuildwheel --output-dir dist - env: - CIBW_BUILD: "cp39-*" - CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010 - CIBW_MANYLINUX_I686_IMAGE: manylinux2010 - CIBW_BEFORE_BUILD_MACOS: brew install gcc@8 - CIBW_ARCHS_WINDOWS: "auto64" - CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" - CIBW_ARCHS: ${{ matrix.cibw_archs }} - - - name: Build wheels for CPython 3.8 + - name: Building wheels run: | python -m cibuildwheel --output-dir dist env: - CIBW_BUILD: "cp38-*" - CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010 - CIBW_MANYLINUX_I686_IMAGE: manylinux2010 - CIBW_BEFORE_BUILD_MACOS: brew install gcc@8 - CIBW_ARCHS_WINDOWS: "auto64" - CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" - CIBW_ARCHS: ${{ matrix.cibw_archs }} + CIBW_BUILD: ${{ matrix.cibw_build }} + CIBW_SKIP: "*musllinux*" + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_BEFORE_ALL_MACOS: brew install llvm && + bash ci-utils/install_prereq_linux.sh && + mkdir -p /tmp/filepattern_bld && + cp -r local_install /tmp/filepattern_bld + CIBW_BEFORE_ALL_LINUX: bash ci-utils/install_prereq_linux.sh && + mkdir -p /tmp/filepattern_bld && + cp -r local_install /tmp/filepattern_bld + CIBW_BEFORE_ALL_WINDOWS: ci-utils\install_prereq_win.bat && + xcopy /E /I /y local_install C:\TEMP\filepattern_bld\local_install - - name: Build wheels for CPython 3.7 - run: | - python -m cibuildwheel --output-dir dist - env: - CIBW_BUILD: "cp37-*" - CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010 - CIBW_MANYLINUX_I686_IMAGE: manylinux2010 - CIBW_BEFORE_BUILD_MACOS: brew install gcc@8 - CIBW_ARCHS_WINDOWS: "auto64" + CIBW_ENVIRONMENT_MACOS: REPAIR_LIBRARY_PATH="/tmp/filepattern_bld/local_install/lib:/tmp/filepattern_bld/local_install/lib64" ON_GITHUB="TRUE" PATH="$(brew --prefix llvm)/bin:$PATH" COMPILER="/usr/local/opt/llvm/bin/clang++" CFLAGS="-I /usr/local/include -I/usr/local/opt/llvm/include" CXXFLAGS="-I /usr/local/include -I/usr/local/opt/llvm/include" LDFLAGS="-L /usr/local/lib -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib" CXX="/usr/local/opt/llvm/bin/clang++" CC="/usr/local/opt/llvm/bin/clang" FILEPATTERN_DEP_DIR="/tmp/filepattern_bld/local_install" + CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH="/tmp/filepattern_bld/local_install/lib:/tmp/filepattern_bld/local_install/lib64:$LD_LIBRARY_PATH" ON_GITHUB="TRUE" FILEPATTERN_DEP_DIR="/tmp/filepattern_bld/local_install" + CIBW_ENVIRONMENT_WINDOWS: PATH="$TEMP\\filepattern\\bin;$PATH" ON_GITHUB="TRUE" FILEPATTERN_DEP_DIR="C:\\TEMP\\filepattern_bld\\local_install" + CIBW_REPAIR_WHEEL_COMMAND_MACOS: DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-listdeps {wheel} && DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" CIBW_ARCHS: ${{ matrix.cibw_archs }} + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: pytest {project}/tests/ - - name: Build wheels for CPython 3.6 - run: | - python -m cibuildwheel --output-dir dist - env: - CIBW_BUILD: "cp36-*" - CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010 - CIBW_MANYLINUX_I686_IMAGE: manylinux2010 - CIBW_BEFORE_BUILD_MACOS: brew install gcc@8 - CIBW_ARCHS_WINDOWS: "auto64" - CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" - CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Install Dependencies run: python -m pip install --upgrade twine requests @@ -98,4 +70,4 @@ jobs: env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - TWINE_REPOSITORY: pypi + TWINE_REPOSITORY: pypi \ No newline at end of file diff --git a/build-wheels-mac.sh b/build-wheels-mac.sh deleted file mode 100755 index 9bc6ba75..00000000 --- a/build-wheels-mac.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -export MACOSX_DEPLOYMENT_TARGET=11.0 - -PYTHON_VERSIONS=("p3.6" "p3.7" "p3.8" "p3.9") - -for PYTHON_VERSION in ${PYTHON_VERSIONS[@]}; do - source /opt/anaconda3/bin/activate ${PYTHON_VERSION} - env CMAKE_ARGS="-DPython_ROOT_DIR=/opt/anaconda3/bin/envs/${PYTHON_VERSION}/" python setup.py bdist_wheel -d dist -done \ No newline at end of file diff --git a/build-wheels.sh b/build-wheels.sh deleted file mode 100755 index 0ed8a9b4..00000000 --- a/build-wheels.sh +++ /dev/null @@ -1,11 +0,0 @@ -PYTHON_VERSIONS=("cp36-cp36m" "cp37-cp37m" "cp38-cp38" "cp39-cp39") - -for PYTHON_VERSION in ${PYTHON_VERSIONS[@]}; do - env CMAKE_ARGS="-DPython_INCLUDE_DIR=/opt/python/${PYTHON_VERSION}/include/python3.6m -DPython_LIBRARY=/opt/python/${PYTHON_VERSION}/lib/" /opt/python/${PYTHON_VERSION}/bin/python setup.py bdist_wheel -d dist - -done - -for whl in ./dist/*.whl; do - auditwheel repair --plat manylinux2010_x86_64 $whl -w ./dist - rm $whl -done \ No newline at end of file diff --git a/ci-utils/install_prereq_linux.sh b/ci-utils/install_prereq_linux.sh index 527dce39..245a7032 100644 --- a/ci-utils/install_prereq_linux.sh +++ b/ci-utils/install_prereq_linux.sh @@ -6,18 +6,18 @@ if [ -z "$1" ] then echo "No path to the Filepattern source location provided" echo "Creating local_install directory" - Z5_INSTALL_DIR="local_install" + LOCAL_INSTALL_DIR="local_install" else - Z5_INSTALL_DIR=$1 + LOCAL_INSTALL_DIR=$1 fi -mkdir -p $Z5_INSTALL_DIR -mkdir -p $Z5_INSTALL_DIR/include +mkdir -p $LOCAL_INSTALL_DIR +mkdir -p $LOCAL_INSTALL_DIR/include git clone https://github.com/pybind/pybind11.git cd pybind11 mkdir build_man cd build_man/ -cmake -DCMAKE_INSTALL_PREFIX=../../$Z5_INSTALL_DIR/ -DPYBIND11_TEST=OFF .. +cmake -DCMAKE_INSTALL_PREFIX=../../$LOCAL_INSTALL_DIR/ -DPYBIND11_TEST=OFF .. make install -j4 cd ../../ diff --git a/install_win_filepattern.bat b/install_win_filepattern.bat deleted file mode 100644 index bc7b243e..00000000 --- a/install_win_filepattern.bat +++ /dev/null @@ -1,12 +0,0 @@ -echo off - -python -m pip install delvewheel -python setup.py bdist_wheel -d dist -pushd dist - -for %%j in (*.whl) do ( - - delvewheel repair %%j - pip install wheelhouse\%%j - ) -popd \ No newline at end of file