Skip to content

Commit

Permalink
Adapt libmambapy tests to scikit-build
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv committed Nov 7, 2023
1 parent a4935bd commit 7d47f84
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/unix_impl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ jobs:
cmake -B build/ -G Ninja \
--preset mamba-unix-shared-${{ inputs.build_type }} \
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
-D CMAKE_C_COMPILER_LAUNCHER=sccache
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
-D BUILD_LIBMAMBAPY=OFF
cmake --build build/ --parallel
- name: Build libmambapy
run: |
# TODO add arguments to use ccache and parallelism
python -m build --no-isolation --skip-dependency-check --wheel --outdir build/dist
- name: Show build cache statistics
run: sccache --show-stats
- name: Lock environment
Expand Down Expand Up @@ -97,9 +102,8 @@ jobs:
environment-name: build_env
- name: Install libmambapy
run: |
ln build/libmambapy/bindings* libmambapy/libmambapy/
cmake --install build/ --prefix "${CONDA_PREFIX}"
python -m pip install ./libmambapy/
python -m pip install ./build/dist/libmambapy*.whl
- name: Run libmamba Python bindings tests
run: |
python -m pytest libmambapy/tests/
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/windows_impl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,15 @@ jobs:
--preset mamba-win-shared-${{ inputs.build_type }} ^
-D CMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDLL" ^
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-D CMAKE_C_COMPILER_LAUNCHER=sccache
-D CMAKE_C_COMPILER_LAUNCHER=sccache ^
-D BUILD_LIBMAMBAPY=OFF
if %errorlevel% neq 0 exit /b %errorlevel%
cmake --build build/ --parallel
if %errorlevel% neq 0 exit /b %errorlevel%
- name: Build libmambapy
run: |
# TODO add arguments to use ccache and parallelism
python -m build --no-isolation --skip-dependency-check --wheel --outdir build/dist
- name: Show build cache statistics
run: sccache --show-stats
- name: Lock environment
Expand Down Expand Up @@ -84,13 +89,6 @@ jobs:
unset CONDARC # Interferes with tests
cd ./build/libmamba && ./tests/test_libmamba
# - name: Run libmamba tests
# run: |
# @REM Interferes with tests
# set CONDARC=
# @REM Move to directory of libmamba DLL for Windows to find it
# cd "build\libmamba" && .\tests\test_libmamba

libmambapy_tests_win:
name: Test libmamba Python bindings
needs: ["build_shared_win"]
Expand All @@ -111,11 +109,9 @@ jobs:
environment-name: build_env
init-shell: bash cmd.exe
- name: Install libmambapy
shell: bash -elo pipefail {0}
run: |
ln build/libmambapy/bindings*.pyd libmambapy/libmambapy/
cmake --install build/ --prefix "${CONDA_PREFIX}"
python -m pip install ./libmambapy/
cmake --install build/ --prefix %CONDA_PREFIX%
python -m pip install .\build\dist\libmambapy*.whl
- name: Run libmamba Python bindings tests
run: |
python -m pytest libmambapy/tests/
Expand Down
2 changes: 1 addition & 1 deletion libmambapy/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def CMAKE_INSTALL_DIR():

skbuild.setup(
packages=["libmambapy", "libmambapy.core"],
package_dir={"": "src/"},
package_dir={"": "src"},
package_data={"libmambapy": ["py.typed", "__init__.pyi"]},
cmake_languages=["CXX"],
cmake_minimum_required_version="3.17",
Expand Down

0 comments on commit 7d47f84

Please sign in to comment.