Skip to content

Commit

Permalink
add piptools
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadRaziei committed Oct 18, 2024
1 parent bc9d818 commit 9301f93
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.10)

option(BUILD_PYTHON "export python module" off)

Expand Down Expand Up @@ -34,9 +34,15 @@ elseif(BUILD_PYTHON)
if(NOT PYTHON_REQUIREMENT_INSTALLED)
execute_process(
COMMAND "${Python3_EXECUTABLE}" -m pip install
nanobind ninja pytest-xdist # build requirements
nanobind ninja pytest-xdist piptools # build requirements
OUTPUT_QUIET
)
execute_process(
COMMAND "${Python3_EXECUTABLE}" -m piptools compile --output-file ${CMAKE_CURRENT_BINARY_DIR}/requirements.txt pyproject.toml
--no-emit-options --quiet --no-strip-extras --extra test
COMMAND "${Python3_EXECUTABLE}" -m pip install -r ${CMAKE_CURRENT_BINARY_DIR}/requirements.txt
OUTPUT_QUIET COMMAND_ERROR_IS_FATAL ANY
)
set(PYTHON_REQUIREMENT_INSTALLED TRUE CACHE INTERNAL "Python requirements installed")
endif()

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [
]

[project.optional-dependencies]
test = ["pytest", "requests"]
test = ["pytest-xdist", "requests"]
online = ["requests"]


Expand Down

0 comments on commit 9301f93

Please sign in to comment.