File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
paddle/fluid/operators/generator Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,35 @@ function(install_py_jinja2)
57
57
execute_process (COMMAND ${PYTHON_EXECUTABLE} -m pip install -U jinja2 )
58
58
endfunction ()
59
59
60
+ function (install_py_pybind11_stubgen )
61
+ # check install
62
+ execute_process (
63
+ COMMAND
64
+ ${PYTHON_EXECUTABLE} "-c"
65
+ "import re, pybind11_stubgen; print(re.compile('/__init__.py.*').sub('',pybind11_stubgen.__file__))"
66
+ RESULT_VARIABLE _pybind11_stubgen_status
67
+ ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE )
68
+
69
+ if (_pybind11_stubgen_status EQUAL 0 )
70
+ # check version
71
+ execute_process (
72
+ COMMAND ${PYTHON_EXECUTABLE} "-c"
73
+ "import pybind11_stubgen; print(pybind11_stubgen.__version__)"
74
+ OUTPUT_VARIABLE _pybind11_stubgen_version
75
+ ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE )
76
+
77
+ if (_pybind11_stubgen_version )
78
+ return ()
79
+ endif ()
80
+ endif ()
81
+
82
+ execute_process (COMMAND ${PYTHON_EXECUTABLE} -m pip install -U
83
+ pybind11-stubgen )
84
+ endfunction ()
85
+
60
86
install_py_pyyaml ()
61
87
install_py_jinja2 ()
88
+ install_py_pybind11_stubgen ()
62
89
63
90
# parse ops
64
91
set (parsed_op_dir ${CMAKE_BINARY_DIR} /paddle/phi/ops/yaml )
You can’t perform that action at this time.
0 commit comments