Skip to content

Commit d6d826c

Browse files
authored
Improves MANIFEST.in (#93)
* Improves MANIFEST.in * setup * disable check release * update setup * fix setup * fix path * fix command line to test a wheel * update cmake messages * fix wheels * fix mypy * update cmake * fix cmake * fix check function * doc * doc
1 parent 235b6bc commit d6d826c

15 files changed

+221
-55
lines changed

.github/workflows/check-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
schedule:
55
# every first day of the month
66
- cron: '0 0 1 * *'
7-
push:
7+
# push:
88

99
jobs:
1010

CHANGELOGS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Change Logs
44
0.2.3
55
+++++
66

7+
* :pr:`93`: validates the wheels in CI
78
* :pr:`89`: add a function to merge models and update them if both have different opsets
89

910
0.2.2

MANIFEST.in

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
recursive-include onnx_extended *.c *.cpp *.h *.pyx *.pxd *.pxi *.py _cmake *.cmake *.in *.txt *.sh
1+
recursive-include onnx_extended *.c *.cpp *.h *.pyx *.pxd *.pxi *.py
2+
recursive-include _cmake *.cmake *.in *.txt *.sh *.in
23
include pyproject.toml
34
include MANIFEST.in
45
include setup.cfg
56
prune _doc
67
prune _unittests
78
exclude *.yml
89
exclude *.git*
10+
# cython files to exclude
11+
exclude onnx_extended/ortcy/ortinf.cpp
12+
exclude onnx_extended/validation/cython/fp8.cpp

_cmake/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ include("finalize.cmake")
8686
#
8787

8888
message(STATUS "---------------------------------------------------")
89-
message(STATUS "WRITE _CONFIG: '${ROOT_PROJECT_PATH}/onnx_extended/_config.py'")
9089
message(STATUS "CONTENT\n ${config_content}")
90+
message(STATUS "WRITE _CONFIG: '${ROOT_PROJECT_PATH}/onnx_extended/_config.py'")
9191
file(WRITE "${ROOT_PROJECT_PATH}/onnx_extended/_config.py" "${config_content}")
92+
message(STATUS "WRITE _CONFIG: '${SETUP_BUILD_LIB}/onnx_extended/_config.py'")
93+
file(WRITE "${SETUP_BUILD_LIB}/onnx_extended/_config.py" "${config_content}")
9294

9395
#
9496
# test

_cmake/constants.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ endif()
1111
message(STATUS "--------------------------------------------")
1212
message(STATUS "--------------------------------------------")
1313
message(STATUS "--------------------------------------------")
14+
message(STATUS "CMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE}")
1415
message(STATUS "ONNX_EXTENDED_VERSION=${ONNX_EXTENDED_VERSION}")
1516
message(STATUS "CMAKE_VERSION=${CMAKE_VERSION}")
1617
message(STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")

_cmake/externals/FindOrt.cmake

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,30 +95,32 @@ endif()
9595
#
9696
# \arg:name target name
9797
# \arg:folder_copy where to copy the assembly
98-
# \arg:folder_copy_ort whenre to copy the dll for onnxruntime
9998
#
100-
function(ort_add_dependency name folder_copy folder_copy_ort)
99+
function(ort_add_dependency name folder_copy)
101100
get_target_property(target_output_directory ${name} BINARY_DIR)
102101
if(MSVC)
103102
set(destination_dir ${target_output_directory}/${CMAKE_BUILD_TYPE})
104103
else()
105104
set(destination_dir ${target_output_directory})
106105
endif()
107-
message(STATUS "ort: copy ${ORT_LIB_FILES_LENGTH} files from '${ONNXRUNTIME_LIB_DIR}' "
108-
"to '${destination_dir}', '${folder_copy}', '${folder_copy_ort}' if it exists")
106+
message(STATUS "ort: copy ${ORT_LIB_FILES_LENGTH} files from '${ONNXRUNTIME_LIB_DIR}'")
109107
foreach(file_i ${ORT_LIB_FILES})
108+
message(STATUS "ort: copy ${file_i} to '${destination_dir}'")
110109
add_custom_command(
111110
TARGET ${name} POST_BUILD
112111
COMMAND ${CMAKE_COMMAND} ARGS -E copy ${file_i} ${destination_dir})
113112
if(folder_copy)
113+
message(STATUS "ort: copy '${file_i}' to '${ROOT_PROJECT_PATH}/${folder_copy}'")
114114
add_custom_command(
115115
TARGET ${name} POST_BUILD
116-
COMMAND ${CMAKE_COMMAND} ARGS -E copy ${file_i} ${folder_copy})
117-
endif()
118-
if(EXISTS folder_copy_ort)
116+
COMMAND ${CMAKE_COMMAND} ARGS -E copy "${file_i}" "${ROOT_PROJECT_PATH}/${folder_copy}")
117+
message(STATUS "ort: copy '${file_i}' to '${SETUP_BUILD_LIB}/${folder_copy}'")
118+
add_custom_command(
119+
TARGET ${name} POST_BUILD
120+
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory "${SETUP_BUILD_LIB}/${folder_copy}")
119121
add_custom_command(
120122
TARGET ${name} POST_BUILD
121-
COMMAND ${CMAKE_COMMAND} ARGS -E copy ${file_i} ${folder_copy_ort})
123+
COMMAND ${CMAKE_COMMAND} ARGS -E copy "${file_i}" "${SETUP_BUILD_LIB}/${folder_copy}")
122124
endif()
123125
endforeach()
124126
# file(COPY ${ORT_LIB_FILES} DESTINATION ${target_output_directory})
@@ -187,9 +189,17 @@ function(ort_add_custom_op name provider folder)
187189
endif()
188190
set_property(TARGET ${name} PROPERTY POSITION_INDEPENDENT_CODE ON)
189191
get_target_property(target_file ${name} LIBRARY_OUTPUT_NAME)
192+
message(STATUS "ort: copy after build '$<TARGET_FILE:${name}>' to '${ROOT_PROJECT_PATH}/${folder}'")
193+
add_custom_command(
194+
TARGET ${name} POST_BUILD
195+
COMMAND ${CMAKE_COMMAND} ARGS -E copy "$<TARGET_FILE:${name}>" "${ROOT_PROJECT_PATH}/${folder}")
196+
message(STATUS "ort: copy after build '$<TARGET_FILE:${name}>' to '${SETUP_BUILD_LIB}//${folder}'")
197+
add_custom_command(
198+
TARGET ${name} POST_BUILD
199+
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory "${SETUP_BUILD_LIB}/${folder}")
190200
add_custom_command(
191201
TARGET ${name} POST_BUILD
192-
COMMAND ${CMAKE_COMMAND} ARGS -E copy $<TARGET_FILE:${name}> ${CMAKE_CURRENT_SOURCE_DIR}/${folder})
202+
COMMAND ${CMAKE_COMMAND} ARGS -E copy "$<TARGET_FILE:${name}>" "${SETUP_BUILD_LIB}/${folder}")
193203
endfunction()
194204

195205
include(FindPackageHandleStandardArgs)

_cmake/targets/ortinf.cmake

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ target_link_libraries(
2626
target_include_directories(ortinf PRIVATE ${ROOT_INCLUDE_PATH})
2727
ort_add_dependency(
2828
ortinf
29-
${CMAKE_CURRENT_SOURCE_DIR}/../onnx_extended/ortcy/wrap/
30-
${SETUP_BUILD_LIB}/onnx_extended/ortcy/wrap/)
29+
onnx_extended/ortcy/wrap)
3130

3231
set(ORTAPI_INCLUDE_DIR "${ROOT_INCLUDE_PATH}/onnx_extended/ortcy/wrap")
3332

@@ -48,5 +47,5 @@ target_link_libraries(
4847
lib_ortapi
4948
onnxruntime
5049
common_kernels)
51-
ort_add_dependency(test_ortcy_inference_cpp "" "")
50+
ort_add_dependency(test_ortcy_inference_cpp "")
5251
add_test(NAME test_ortcy_inference_cpp COMMAND test_ortcy_inference_cpp)

_cmake/targets/ortops_optim_cpu.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ message(STATUS "+ KERNEL onnx_extended.ortops.optim.cpu")
66
ort_add_custom_op(
77
ortops_optim_cpu
88
"CPU"
9-
../onnx_extended/ortops/optim/cpu
9+
onnx_extended/ortops/optim/cpu
1010
../onnx_extended/ortops/optim/cpu/tree_ensemble.cc
1111
../onnx_extended/ortops/optim/cpu/ort_optim_cpu_lib.cc)
1212

_cmake/targets/ortops_tutorial_cpu.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ message(STATUS "+ KERNEL onnx_extended.ortops.tutorial.cpu")
66
ort_add_custom_op(
77
ortops_tutorial_cpu
88
"CPU"
9-
../onnx_extended/ortops/tutorial/cpu
9+
onnx_extended/ortops/tutorial/cpu
1010
../onnx_extended/ortops/tutorial/cpu/custom_gemm.cc
1111
../onnx_extended/ortops/tutorial/cpu/dynamic_quantize_linear.cc
1212
../onnx_extended/ortops/tutorial/cpu/my_kernel.cc

_cmake/targets/ortops_tutorial_cuda.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if(CUDA_AVAILABLE)
99
ort_add_custom_op(
1010
ortops_tutorial_cuda
1111
CUDA
12-
../onnx_extended/ortops/tutorial/cuda
12+
onnx_extended/ortops/tutorial/cuda
1313
../onnx_extended/ortops/tutorial/cuda/custom_gemm.cu
1414
../onnx_extended/ortops/tutorial/cuda/ort_tutorial_cuda_lib.cc)
1515

0 commit comments

Comments
 (0)