Fetch nanobind with cmake (#2949)

This commit is contained in:
Cheng
2025-12-24 10:23:45 +09:00
committed by GitHub
parent 1d21d0e696
commit 26dfe4f651
10 changed files with 63 additions and 75 deletions
@@ -18,12 +18,9 @@ inputs:
runs:
using: "composite"
steps:
- name: Generate package stubs
- name: Build MLX
shell: bash
run: |
pip install -e ".[dev]" -v
pip install typing_extensions
python setup.py generate_stubs
run: pip install -e . -v
- name: Build Python package
shell: bash
+2 -8
View File
@@ -21,19 +21,13 @@ runs:
if ${{ startsWith(inputs.toolkit, 'cuda') && runner.arch == 'arm64' }} ; then
# There is no GPU in arm64 runner, use a common arch.
CMAKE_ARGS="$CMAKE_ARGS -DMLX_CUDA_ARCHITECTURES=90a"
# Can not build tests when the built executables can not run.
CMAKE_ARGS="$CMAKE_ARGS -DMLX_BUILD_TESTS=OFF"
# Can not build tests and stubs when the built executables can not run.
CMAKE_ARGS="$CMAKE_ARGS -DMLX_BUILD_TESTS=OFF -DMLX_BUILD_PYTHON_STUBS=OFF"
fi
pip install --no-build-isolation -e ".[dev]" -v
# Pass the CMAKE_ARGS to following steps.
echo CMAKE_ARGS="$CMAKE_ARGS" >> $GITHUB_OUTPUT
- name: Generate package stubs
shell: sh
run: |
pip install typing_extensions
python setup.py generate_stubs
- name: Build CPP only
shell: bash
run: |
+1 -7
View File
@@ -11,15 +11,9 @@ runs:
shell: bash -l {0}
run: |
pip install --upgrade pip
pip install cmake setuptools nanobind==2.10.2
pip install cmake setuptools typing_extensions
pip install -e . -v
- name: Generate package stubs
shell: bash -l {0}
run: |
pip install typing_extensions
python setup.py generate_stubs
- name: Install tests dependencies
shell: bash -l {0}
run: |
+2 -2
View File
@@ -48,9 +48,9 @@ runs:
echo "::group::Setup Python venv"
python -m venv .venv
source .venv/bin/activate
pip install setuptools cmake nanobind==2.10.2
pip install setuptools cmake typing_extensions
echo PATH=$PATH >> $GITHUB_ENV
# Make cmake search .venv for nanobind
# Search python packages in .venv
echo PYTHONPATH=`python -c 'import sys; print(sys.path[-1])'` >> $GITHUB_ENV
echo "::endgroup::"
+1 -6
View File
@@ -98,13 +98,8 @@ jobs:
shell: bash -l {0}
run: |
pip install --upgrade pip
pip install cmake setuptools nanobind==2.10.2
pip install cmake setuptools typing_extensions
pip install -e . -v
- name: Generate package stubs
shell: bash -l {0}
run: |
pip install typing_extensions
python setup.py generate_stubs
- name: Build macOS 14 package
uses: ./.github/actions/build-macos-release
with: