From 40d69457b740e996750f3d4d09ed2a7dc6ae60ad Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 2 Apr 2024 14:43:10 -0500 Subject: [PATCH] fix win 3 --- recipe/build_openmm.bat | 13 +++++-------- recipe/rename_wheel.py | 12 ++++++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 recipe/rename_wheel.py diff --git a/recipe/build_openmm.bat b/recipe/build_openmm.bat index 40b1d8f..bc4163b 100644 --- a/recipe/build_openmm.bat +++ b/recipe/build_openmm.bat @@ -65,24 +65,21 @@ for %%f in (dist\*.whl) do ( cd openmm-cuda %PYTHON% -m pip wheel . --wheel-dir=%SRC_DIR%\build\python\dist -vv -cd %SRC_DIR%\build\python\dist +cd %SRC_DIR%\build\python -for %%f in (*.whl) do ( +for %%f in (dist\*.whl) do ( echo "fixing %%f" cd %LIBRARY_PREFIX% %PYTHON% ^ %RECIPE_DIR%\vendor_wheel.py ^ - %SRC_DIR%\build\python\dist\%%f ^ + %SRC_DIR%\build\python\%%f ^ lib\plugins\OpenMMCUDA.dll ^ lib\plugins\OpenMMRPMDCUDA.dll ^ lib\plugins\OpenMMAmoebaCUDA.dll ^ lib\plugins\OpenMMDrudeCUDA.dll if errorlevel 1 exit 1 - cd %SRC_DIR%\build\python\dist - set "fname=%%f" - dir - echo %fname% ..\fixed_wheels\%fname:~0,-7%win_amd64.whl - move %fname% ..\fixed_wheels\%fname:~0,-7%win_amd64.whl + cd %SRC_DIR%\build\python + %PYTHON% %RECIPE_DIR%\rename_wheel.py %%f win_amd64.whl fixed_wheels if errorlevel 1 exit 1 ) diff --git a/recipe/rename_wheel.py b/recipe/rename_wheel.py new file mode 100644 index 0000000..119c024 --- /dev/null +++ b/recipe/rename_wheel.py @@ -0,0 +1,12 @@ +import os +import shutil +import sys + +def rename(fname, new_suffix, new_dest): + assert fname.endswith(".whl") + prefix, dash, _ = fname.rpartition("-") + new_fname = os.path.basename(prefix + dash + new_suffix) + shutil.move(fname, os.path.join(new_dest, new_fname)) + +if __name__ == "__main__": + rename(*sys.argv[1:])