Skip to content

Commit fcc4658

Browse files
authored
Wheel: Separate Directory (#3320)
* Wheel: Separate Directory The `pip_install` target did not yet work on Windows, because it has no universal wildcard `*` support for our pip install logic. Fix this by creating the wheel in a sub-directory and installing it by "finding all wheels for `pywarpx` in a given prefix". - Avoid wildcards by using a separate directory. - Avoid downloading deps during `wheel` build again. * Fix: Manifest follow-up to #3265
1 parent 642f6c0 commit fcc4658

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

.github/workflows/windows.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ jobs:
4040
4141
python3 -m pip install --upgrade pip setuptools wheel
4242
if(!$?) { Exit $LASTEXITCODE }
43-
python3 -m pip install --upgrade cmake
44-
if(!$?) { Exit $LASTEXITCODE }
45-
$env:PYWARPX_LIB_DIR="$(Get-Location | Foreach-Object { $_.Path })\build\lib\Debug\"
46-
python3 -m pip install . -vv --no-build-isolation
43+
cmake --build build --config Debug --target pip_install
4744
if(!$?) { Exit $LASTEXITCODE }
4845
4946
python3 Examples\Modules\gaussian_beam\PICMI_inputs_gaussian_beam.py
@@ -90,10 +87,7 @@ jobs:
9087
9188
python3 -m pip install --upgrade pip setuptools wheel
9289
if errorlevel 1 exit 1
93-
python3 -m pip install --upgrade cmake
94-
if errorlevel 1 exit 1
95-
set "PYWARPX_LIB_DIR=%cd%\build\lib\"
96-
python3 -m pip install . -vv --no-build-isolation
90+
cmake --build build --config Release --target pip_install
9791
if errorlevel 1 exit 1
9892
9993
python3 Examples\Modules\gaussian_beam\PICMI_inputs_gaussian_beam.py --diagformat=openpmd

CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,10 @@ if(WarpX_LIB)
436436

437437
# build the wheel by re-using the shared library we build
438438
add_custom_target(${WarpX_CUSTOM_TARGET_PREFIX}pip_wheel
439-
${CMAKE_COMMAND} -E rm -f ${WarpX_BINARY_DIR}/pywarpx*whl
439+
${CMAKE_COMMAND} -E rm -f -r warpx-whl
440440
COMMAND
441-
${CMAKE_COMMAND} -E env PYWARPX_LIB_DIR=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
442-
python3 -m pip wheel -v --no-build-isolation ${WarpX_SOURCE_DIR}
441+
${CMAKE_COMMAND} -E env PYWARPX_LIB_DIR=$<TARGET_FILE_DIR:shared>
442+
python3 -m pip wheel -v --no-build-isolation --no-deps --wheel-dir=warpx-whl ${WarpX_SOURCE_DIR}
443443
WORKING_DIRECTORY
444444
${WarpX_BINARY_DIR}
445445
DEPENDS
@@ -463,7 +463,7 @@ if(WarpX_LIB)
463463
# because otherwise pip would also force reinstall all dependencies.
464464
add_custom_target(${WarpX_CUSTOM_TARGET_PREFIX}pip_install
465465
${CMAKE_COMMAND} -E env WARPX_MPI=${WarpX_MPI}
466-
python3 -m pip install --force-reinstall --no-deps ${PYINSTALLOPTIONS} ${WarpX_BINARY_DIR}/pywarpx*whl
466+
python3 -m pip install --force-reinstall --no-index --no-deps ${PYINSTALLOPTIONS} --find-links=warpx-whl pywarpx
467467
WORKING_DIRECTORY
468468
${WarpX_BINARY_DIR}
469469
DEPENDS

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include README.md LEGAL.txt LICENSE.txt
22
include pyproject.toml
3-
include requirements.txt
3+
include requirements.txt requirements_mpi.txt
44
global-include CMakeLists.txt *.cmake *.in
55
recursive-include Source *
66
recursive-include Python *

0 commit comments

Comments
 (0)