change SDKROOT 2 #119
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy-conda | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
jobs: | |
build_wheels: | |
name: Build wheels, ${{ matrix.os }}, ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ['cp39', 'cp310', 'cp311', 'cp312'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
# Without this, installing cuda give error: no much space left on device | |
- name: Clear Cache | |
if: matrix.os != 'windows-latest' | |
run: rm -rf /opt/hostedtoolcache | |
# Build wheel for windows X86_64 | |
- name: Build wheels in windows (X86_64) Python ${{ matrix.python-version }} | |
if: matrix.os == 'windows-latest' | |
uses: pypa/[email protected] | |
env: | |
CIBW_ARCHS_WINDOWS: "AMD64 x86" | |
CIBW_BUILD: "${{ matrix.python-version }}-win_amd64" | |
CIBW_SKIP: "pp* cp36-* cp37-* cp38-*" | |
CIBW_BUILD_VERBOSITY: 3 | |
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" | |
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" | |
with: | |
output-dir: wheelhouse | |
# Build wheel for windows ARM64 (DO NOT USE) | |
# Note: DO NOT build ARM64 for windows. The reason is that this github runner is an X86_64 | |
# machine. To build ARM64 wheels, cibuildwheels uses "cross compiling". This is supported | |
# possible when the build tool is "setuptools". But currently, it is not supported using meson.build. | |
# Since, this package uses meson.build, as such, cross compiling for ARM64 is not possible. | |
# To read more, see: https://cibuildwheel.readthedocs.io/en/stable/faq/#windows-arm64 | |
# - name: Build wheels in windows (ARM64) Python ${{ matrix.python-version }} | |
# if: matrix.os == 'windows-latest' | |
# uses: pypa/[email protected] | |
# env: | |
# CIBW_ARCHS_WINDOWS: "ARM64" | |
# CIBW_BUILD: "${{ matrix.python-version }}-win_arm64" | |
# CIBW_SKIP: "pp37-* cp36-* cp37-* cp38-*" | |
# CIBW_BUILD_VERBOSITY: 3 | |
# CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" | |
# CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" | |
# with: | |
# output-dir: wheelhouse | |
# Build wheel for macos X86_64. | |
# Note that wheels for macos ARM64 will be built on cirrus ci (see /tools/ci) | |
- name: Build wheels in mac (X86_64) Python ${{ matrix.python-version }} | |
if: matrix.os == 'macos-latest' | |
uses: pypa/[email protected] | |
env: | |
CIBW_ARCHS_MACOS: "x86_64" | |
CIBW_BUILD: "${{ matrix.python-version }}-macosx_x86_64" | |
CIBW_SKIP: "pp* cp36-* cp37-* cp38-*" | |
CIBW_BUILD_VERBOSITY: 3 | |
CIBW_BEFORE_BUILD: brew reinstall gcc | |
with: | |
output-dir: wheelhouse | |
# Build wheel for linux X86_64. | |
# Note that wheels for linux AARCH64 will be built on cirrus ci (see /tools/ci) | |
- name: Build wheels in linux (X86_64) Python ${{ matrix.python-version }} | |
if: matrix.os == 'ubuntu-latest' | |
uses: pypa/[email protected] | |
env: | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
CIBW_ARCHS_LINUX: "x86_64" | |
CIBW_BUILD: "${{ matrix.python-version }}-manylinux_x86_64" | |
CIBW_SKIP: "pp* cp36-* cp37-* cp38-*" | |
CIBW_BUILD_VERBOSITY: 3 | |
# CIBW_BEFORE_BUILD_LINUX: yum update; yum install gcc-gfortran openblas-devel.x86_64 lapack-devel.x86_64 -y | |
with: | |
output-dir: wheelhouse | |
# Upload all wheels to an artifact | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts-wheel-${{ matrix.os }}-${{ matrix.python-version }} | |
path: ./wheelhouse/*.whl | |
retention-days: 1 | |
build_conda: | |
needs: [build_wheels] | |
name: Build conda on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
# To upload to PyPI on every tag starting with 'v', use the following: | |
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | |
# To publish to pypi on each GitHub Release, use the following: | |
# if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- name: Clean runner space | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
docker system prune -af | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: artifacts-* | |
merge-multiple: true | |
path: dist | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: "latest" | |
auto-update-conda: true | |
- name: Build and upload package | |
shell: bash -el {0} | |
run: | | |
conda install -y conda-build anaconda-client | |
conda config --set anaconda_upload yes | |
export PATH=$(conda info --root):$PATH | |
export PATH=$(conda info --root)/bin:$PATH | |
conda build --output-folder conda-bld . | |
env: | |
CYTHON_BUILD_IN_SOURCE: '1' # see setup.py. Avoids a bug when building with multiple python variants | |
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
# The manylinux wheels (after repaired with auditwheel) are very | |
# large in size. It is better to delete them. If we do not delete | |
# them, however, they will be deleted after the retention days, | |
# which I set to one day. | |
- name: Delete artifacts | |
uses: geekyeggo/delete-artifact@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: artifacts-* | |
test_conda: | |
needs: [build_conda] | |
name: Test on ${{ matrix.os }} and Python ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
steps: | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
activate-environment: myenv | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Remove MKL as it causes error in initializing libomp. This only happens in MacOS and | |
# the conda (but not pip) installation of this package. | |
- name: Remove MKL in MacOS | |
if: matrix.os == 'macos-latest' | |
shell: bash -l {0} | |
run: | | |
conda install nomkl | |
conda remove mkl mkl-service || true # use true since if mkl or mkl-service does not exist, conda throw error and fails the whole runner action to continue | |
- name: Test | |
shell: bash -l {0} | |
run: | | |
mv special_functions special_functions-DoNotImport | |
rm setup.cfg | |
conda install -c s-ameli special_functions -y | |
conda install scipy -y | |
conda install pytest -y | |
pytest |