Skip to content

Commit 446d03e

Browse files
committed
Replace python install with choco
1 parent 39a253f commit 446d03e

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: windows-latest
1717
strategy:
1818
matrix:
19-
python-versions: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
19+
python-versions: [38, 39, 310, 311, 312, 313]
2020

2121
steps:
2222
- uses: actions/checkout@v4
@@ -37,9 +37,7 @@ jobs:
3737
mv ../includeFaceSDK ./include
3838
3939
- name: Install Python
40-
uses: actions/setup-python@v5
41-
with:
42-
python-version: "${{ matrix.python-versions }}"
40+
run: choco install python${{ matrix.python-versions }} -y
4341

4442
- name: Install build
4543
run: pip install build

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Visual Studio
22
.vs/
3+
out/
34

45
# Python venv
56
.venv/
7+
8+
# Build
9+
dist/

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ set(PYBIND11_TAG v3.0.0)
77
if (UNIX)
88
set(PYTHON_EXECUTABLE /usr/bin/python3 CACHE STRING "Path to Python executable")
99
else()
10+
set(PYBIND11_FINDPYTHON OFF)
11+
1012
find_package(Python REQUIRED)
1113

1214
set(PYTHON_EXECUTABLE ${Python_EXECUTABLE} CACHE STRING "Path to Python executable")
13-
set(PYBIND11_FINDPYTHON OFF)
1415
endif()
1516
set(FACE_SDK_INCLUDE_PATH "FaceSDK/include" CACHE STRING "Path to include directory")
1617

@@ -68,7 +69,7 @@ else()
6869
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
6970

7071
COMMAND ${PYTHON_EXECUTABLE} -m venv .venv
71-
COMMAND .venv/bin/python -m pip install pybind11-stubgen numpy
72+
COMMAND .venv/bin/python -m pip install pybind11-stubgen \"numpy<=1.26.4\"
7273
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/*.so ${CMAKE_BINARY_DIR}/.venv/lib/python3.${PYTHON_MINOR_VERSION}/site-packages
7374
COMMAND ${CMAKE_BINARY_DIR}/.venv/bin/pybind11-stubgen -o ${CMAKE_BINARY_DIR} ${PROJECT_NAME}
7475
COMMAND ${CMAKE_COMMAND} -E rm -rf .venv
@@ -80,7 +81,7 @@ else()
8081
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
8182
8283
COMMAND ${PYTHON_EXECUTABLE} -m venv .venv
83-
COMMAND .venv/Scripts/python -m pip install pybind11-stubgen numpy
84+
COMMAND .venv/Scripts/python -m pip install pybind11-stubgen \"numpy<=1.26.4\"
8485
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${PROJECT_NAME}> ${CMAKE_BINARY_DIR}/.venv/Lib/site-packages
8586
COMMAND ${CMAKE_BINARY_DIR}/.venv/Scripts/pybind11-stubgen -o ${CMAKE_BINARY_DIR} ${PROJECT_NAME}
8687
COMMAND ${CMAKE_COMMAND} -E rm -rf .venv

0 commit comments

Comments
 (0)