diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ce76919..7f5b31d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 81c5044..ef22ea9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/set_CIBW_BUILD.sh b/set_CIBW_BUILD.sh new file mode 100644 index 0000000..626beeb --- /dev/null +++ b/set_CIBW_BUILD.sh @@ -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 \ No newline at end of file