Skip to content

Commit b0bffb8

Browse files
authored
update doctest and pybind dependencies (#212)
* update doctest to v2.4.12 * update pybind to v3.0.1 * fix venv for pytest; update changelog
1 parent 929e16a commit b0bffb8

4 files changed

Lines changed: 16 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Changes:
99
* Update Python packaging: move `setup.cfg` metadata to `pyproject.toml` ([#207](https://github.com/xcsf-dev/xcsf/pull/207))
1010
* Fix macOS building with AppleClang ([#210](https://github.com/xcsf-dev/xcsf/pull/210))
1111
* Add support for Python 3.14 ([#211](https://github.com/xcsf-dev/xcsf/pull/211))
12+
* Update pybind11 to v3.0.1 and doctest to v2.4.12 ([#212](https://github.com/xcsf-dev/xcsf/pull/212))
1213

1314
## Version 1.4.7 (Aug 19, 2024)
1415

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,31 +178,43 @@ if(XCSF_PYLIB)
178178
file(COPY ${PYTHON_EXAMPLES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
179179
file(COPY "xcsf/utils/" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/xcsf/utils/)
180180
file(COPY "xcsf/__init__.py" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/xcsf/)
181+
181182
if(PYTEST)
182183
# Copy the Python tests
183184
file(GLOB PYTHON_TESTS "test/python/*.py")
184185
file(COPY ${PYTHON_TESTS} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
186+
187+
# Check Python executable has been found
188+
if(NOT Python_EXECUTABLE)
189+
message(FATAL_ERROR "Python_EXECUTABLE is not set")
190+
endif()
191+
185192
# Create a virtual environment
186193
set(VENV_DIR "${CMAKE_CURRENT_BINARY_DIR}/venv")
187-
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -m venv "${VENV_DIR}")
194+
execute_process(COMMAND "${Python_EXECUTABLE}" -m venv "${VENV_DIR}")
195+
188196
# Activate the virtual environment
189197
if(WIN32)
190198
set(PYTHON_EXEC "${VENV_DIR}/Scripts/python")
191199
else()
192200
set(PYTHON_EXEC "${VENV_DIR}/bin/python")
193201
endif()
202+
194203
# Install dependencies
195204
execute_process(
196205
COMMAND "${PYTHON_EXEC}" -m pip install pytest numpy scikit-learn
197206
)
207+
198208
# Add pytest to ctest (to capture CI failures)
199209
add_test(NAME pytest COMMAND "${PYTHON_EXEC}" -m pytest .)
210+
200211
# Execute pytest at the end of building
201212
add_custom_target(run_tests ALL
202213
COMMAND "${PYTHON_EXEC}" -m pytest .
203214
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
204215
COMMENT "Running pytest..."
205216
)
217+
206218
# Wait for XCSF to be built
207219
add_dependencies(run_tests xcsf)
208220
endif()

lib/doctest

lib/pybind11

Submodule pybind11 updated 271 files

0 commit comments

Comments
 (0)