Skip to content

Commit 49ae70c

Browse files
committed
[actions] Include DLLs required to run package
1 parent 1193231 commit 49ae70c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.github/workflows/build_wheels_windows.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,8 @@ jobs:
7777
echo "Adding CUDA to PATH..."
7878
$CUDA_PATH = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4"
7979
echo "CUDA_PATH=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Append
80+
Copy-Item -Path "$CUDA_PATH/bin/*" -Destination . -Include "*.dll"
8081
shell: pwsh
81-
#$arguments = "-s cublas_12.4 cublas_dev_12.4 cudart_12.4 cufft_12.4 cufft_dev_12.4 npp_12.4 npp_dev_12.4 nvcc_12.4"
82-
#echo "$CUDA_PATH\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
83-
#echo "$CUDA_PATH\lib\x64" | Out-File -FilePath $env:GITHUB_PATH -Append
84-
#echo "$CUDA_PATH"
8582
- name: Cache CuDNN Installer
8683
id: cache-cudnn-installer
8784
uses: actions/cache@v3
@@ -104,6 +101,7 @@ jobs:
104101
$CUDNN_PATH = "D:/a/opencv-python-cuda/opencv-python-cuda/cudnn-windows-x86_64-8.9.7.29_cuda12-archive"
105102
echo "CUDNN_LIBRARY=$CUDNN_PATH/lib/x64/cudnn.lib" | Out-File -FilePath $env:GITHUB_ENV -Append
106103
echo "CUDNN_INCLUDE_DIR=$CUDNN_PATH/include" | Out-File -FilePath $env:GITHUB_ENV -Append
104+
Copy-Item -Path "$CUDNN_PATH/bin/*" -Destination . -Include "*.dll"
107105
shell: pwsh
108106

109107
- name: Build a package
@@ -114,6 +112,7 @@ jobs:
114112
python -m pip install --upgrade setuptools
115113
python -m pip install cmake==3.24.2
116114
python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt
115+
dir
117116
set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v
118117
shell: cmd
119118
- name: Saving all wheels

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import glob
12
import io
23
import os
34
import os.path
@@ -140,7 +141,7 @@ def main():
140141

141142
# Files in sourcetree outside package dir that should be copied to package.
142143
# Raw paths relative to sourcetree root.
143-
files_outside_package_dir = {"cv2": ["LICENSE.txt", "LICENSE-3RD-PARTY.txt"]}
144+
files_outside_package_dir = {"cv2": ["LICENSE.txt", "LICENSE-3RD-PARTY.txt, *.dll"]}
144145

145146
ci_cmake_generator = (
146147
["-G", "Visual Studio 17 2022"]
@@ -453,7 +454,10 @@ def _classify_installed_files_override(
453454

454455
for package_name, paths in cls.files_outside_package.items():
455456
package_dest_reldir = package_name.replace(".", os.path.sep)
457+
expanded_paths = []
456458
for path in paths:
459+
expanded_paths += [path] if not '*' in path else glob.glob(path)
460+
for path in expanded_paths:
457461
new_install_relpath = os.path.join(
458462
package_dest_reldir,
459463
# Don't yet have a need to copy

0 commit comments

Comments
 (0)