Skip to content

Commit

Permalink
Fix macos ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Routhleck committed Aug 25, 2024
1 parent ed039c1 commit 1647987
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", ]
python-version: [ "3.9", "3.10", "3.11", "3.12"]

steps:
- name: Cancel Previous Runs
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", ]
python-version: [ "3.9", "3.10", "3.11", "3.12"]

steps:
- name: Cancel Previous Runs
Expand All @@ -79,6 +79,7 @@ jobs:
python -m pip install --upgrade pip setuptools --no-cache-dir
python -m pip install -r requirements-dev.txt --no-cache-dir
pip install cibuildwheel
sh set_CIBW_BUILD.sh
cibuildwheel --platform macos
pip install dist/*
- name: Test with pytest
Expand All @@ -91,7 +92,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", ]
python-version: [ "3.9", "3.10", "3.11", "3.12"]

steps:
- name: Cancel Previous Runs
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ requires = [
"pybind11",
"setuptools_scm[toml]>=3.4",
"cmake",
"taichi",
]

build-backend = "setuptools.build_meta"

[project]
requires-python = ">=3.9"
requires-python = ">=3.8, <=3.12"
name = "braintaichi"
version = "0.0.1"

Expand Down
20 changes: 20 additions & 0 deletions set_CIBW_BUILD.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Get the current Python version
python_version=$(python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))")

# Set the CIBW_BUILD environment variable based on the Python version
if [[ $python_version == "3.8" ]]; then
export CIBW_BUILD="cp38-macosx_x86_64"
elif [[ $python_version == "3.9" ]]; then
export CIBW_BUILD="cp39-macosx_x86_64*"
elif [[ $python_version == "3.10" ]]; then
export CIBW_BUILD="cp310-macosx_x86_64*"
elif [[ $python_version == "3.11"]]; then
export CIBW_BUILD="cp311-macosx_x86_64"
elif [[ $python_version == "3.12"]]; then
export CIBW_BUILD="cp312-macosx_x86_64"
else
echo "Unsupported Python version: $python_version"
exit 1
fi

0 comments on commit 1647987

Please sign in to comment.