Skip to content

Commit

Permalink
minor simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
wjakob committed Feb 2, 2023
1 parent d04f71f commit 13048f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
platform: [windows-latest, macos-latest, ubuntu-latest]
python-version: ["3.8", "3.10"]
python-version: ["3.8", "3.11"]

steps:
- uses: actions/checkout@v3
Expand All @@ -27,7 +27,7 @@ jobs:
- name: Set min macOS version
if: runner.os == 'macOS'
run: |
echo "MACOS_DEPLOYMENT_TARGET=10.9" >> $GITHUB_ENV
echo "MACOS_DEPLOYMENT_TARGET=10.14" >> $GITHUB_ENV
- name: Build and install
run: python -m pip install pytest
Expand Down
14 changes: 3 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ if (SKBUILD)
set(Python_EXECUTABLE "${PYTHON_EXECUTABLE}")
set(Python_INCLUDE_DIR "${PYTHON_INCLUDE_DIR}")
set(Python_LIBRARY "${PYTHON_LIBRARY}")

message(STATUS "Information from scikit-build:")
message(STATUS " - Python_VERSION_STRING = ${Python_VERSION_STRING}")
message(STATUS " - Python_EXECUTABLE = ${Python_EXECUTABLE}")
message(STATUS " - Python_INCLUDE_DIR = ${Python_INCLUDE_DIR}")
message(STATUS " - Python_LIBRARY = ${Python_LIBRARY}")
elseif (MSVC)
# MSVC needs a little extra help finding the Python library
find_package(PythonInterp)
Expand All @@ -55,11 +49,9 @@ endif()

# Run `nanobind.cmake_dir()` from Python to detect where nanobind is installed
execute_process(
COMMAND
"${PYTHON_EXECUTABLE}" -c "import nanobind; print(nanobind.cmake_dir())"
OUTPUT_VARIABLE _tmp_dir
OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND_ECHO STDOUT)
list(APPEND CMAKE_PREFIX_PATH "${_tmp_dir}")
COMMAND "${Python_EXECUTABLE}" -c "import nanobind; print(nanobind.cmake_dir())"
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE NB_DIR)
list(APPEND CMAKE_PREFIX_PATH "${NB_DIR}")

# Now, import nanobind through CMake's find_package mechanism
find_package(nanobind CONFIG REQUIRED)
Expand Down

0 comments on commit 13048f8

Please sign in to comment.