forked from openvinotoolkit/openvino.genai
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Build] Added PYI files check (openvinotoolkit#1214)
- Loading branch information
1 parent
a7cda8f
commit 76bf49e
Showing
7 changed files
with
203 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
cmake~=3.30 | ||
cmake~=3.23.0 | ||
pybind11-stubgen==2.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
foreach(var IN ITEMS generated_pyi_files_location source_pyi_files_location) | ||
if(NOT DEFINED ${var}) | ||
message(FATAL_ERROR "Variable ${var} is not defined") | ||
endif() | ||
endforeach() | ||
|
||
file(GLOB_RECURSE pyi_files ${generated_pyi_files_location}/*.pyi) | ||
|
||
# perform comparison of generated files with committed ones | ||
foreach(pyi_file IN LISTS pyi_files) | ||
string(REPLACE ${generated_pyi_files_location} ${source_pyi_files_location} commited_pyi_file "${pyi_file}") | ||
if(NOT EXISTS "${commited_pyi_file}") | ||
message(FATAL_ERROR "${commited_pyi_file} does not exists. Please, install pybind11-stubgen and generate .pyi files") | ||
else() | ||
execute_process(COMMAND "${CMAKE_COMMAND}" -E compare_files "${pyi_file}" "${commited_pyi_file}" | ||
OUTPUT_VARIABLE output_message | ||
ERROR_VARIABLE error_message | ||
RESULT_VARIABLE exit_code | ||
OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
if(NOT exit_code EQUAL 0) | ||
message(FATAL_ERROR "File ${commited_pyi_file} is outdated and need to be regenerated with pybind11-stubgen") | ||
endif() | ||
endif() | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters