diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e0c6efdc9..ec380186d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -16,12 +16,15 @@ jobs: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: TRUE steps: - uses: actions/checkout@v4 - - name: install dependencies + - uses: actions/setup-python@v5 + name: Install Python + with: + python-version: '3.x' + - name: install brew dependencies run: | set +e brew unlink gcc brew update - brew install --overwrite python brew install adios2 brew install ccache brew install cmake @@ -32,19 +35,15 @@ jobs: brew install ninja brew install open-mpi brew install pkg-config - - python3 -m pip install --upgrade pip - python3 -m pip install --upgrade virtualenv - - python3 -m venv py-venv - source py-venv/bin/activate + set -e + - name: install pip dependencies + run: | python3 -m pip install --upgrade pip python3 -m pip install --upgrade build packaging setuptools wheel pytest python3 -m pip install --upgrade -r requirements_mpi.txt python3 -m pip install --upgrade -r src/python/impactx/dashboard/requirements.txt python3 -m pip install --upgrade -r examples/requirements.txt python3 -m pip install --upgrade -r tests/python/requirements.txt - set -e python3 -m pip install --upgrade pipx python3 -m pipx install openPMD-validator - name: CCache Cache @@ -65,13 +64,10 @@ jobs: export CCACHE_SLOPPINESS=time_macros ccache -z - source py-venv/bin/activate - cmake -S . -B build \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DImpactX_FFT=ON \ - -DImpactX_PYTHON=ON \ - -DPython_EXECUTABLE=$(which python3) + -DImpactX_PYTHON=ON cmake --build build -j 3 du -hs ~/Library/Caches/ccache @@ -79,15 +75,12 @@ jobs: - name: run tests run: | - source py-venv/bin/activate - ctest --test-dir build --output-on-failure -E pytest.AMReX - name: run installed python module run: | cmake --build build --target pip_install - source py-venv/bin/activate python3 examples/fodo/run_fodo.py - name: run installed app diff --git a/CMakeLists.txt b/CMakeLists.txt index a552d5fd9..2ad0166d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -394,9 +394,9 @@ install(CODE "file(CREATE_LINK # if(ImpactX_PYTHON) set(PY_PIP_OPTIONS "-v" CACHE STRING - "Additional parameters to pass to `pip`") + "Additional parameters to pass to `pip` as ; separated list") set(PY_PIP_INSTALL_OPTIONS "" CACHE STRING - "Additional parameters to pass to `pip install`") + "Additional parameters to pass to `pip install` as ; separated list") # add a prefix to custom targets so we do not collide if used as a subproject if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) @@ -412,7 +412,8 @@ if(ImpactX_PYTHON) ${CMAKE_COMMAND} -E rm -f -r impactx-whl COMMAND ${CMAKE_COMMAND} -E env PYIMPACTX_LIBDIR=$ - ${Python_EXECUTABLE} -m pip ${PY_PIP_OPTIONS} wheel --no-build-isolation --no-deps --wheel-dir=impactx-whl ${ImpactX_SOURCE_DIR} + ${Python_EXECUTABLE} -m pip ${PY_PIP_OPTIONS} wheel --no-build-isolation --no-deps --wheel-dir=impactx-whl "${ImpactX_SOURCE_DIR}" + COMMAND_EXPAND_LISTS VERBATIM WORKING_DIRECTORY ${ImpactX_BINARY_DIR} DEPENDS @@ -427,6 +428,7 @@ if(ImpactX_PYTHON) endif() add_custom_target(${ImpactX_CUSTOM_TARGET_PREFIX}pip_install_requirements ${Python_EXECUTABLE} -m pip ${PY_PIP_OPTIONS} install ${PY_PIP_INSTALL_OPTIONS} -r "${ImpactX_SOURCE_DIR}/${pyImpactX_REQUIREMENT_FILE}" + COMMAND_EXPAND_LISTS VERBATIM WORKING_DIRECTORY ${ImpactX_BINARY_DIR} ) @@ -444,6 +446,7 @@ if(ImpactX_PYTHON) add_custom_target(${ImpactX_CUSTOM_TARGET_PREFIX}pip_install ${CMAKE_COMMAND} -E env IMPACTX_MPI=${ImpactX_MPI} ${Python_EXECUTABLE} -m pip ${PY_PIP_OPTIONS} install --force-reinstall --no-index --no-deps ${PY_PIP_INSTALL_OPTIONS} --find-links=impactx-whl impactx + COMMAND_EXPAND_LISTS VERBATIM WORKING_DIRECTORY ${ImpactX_BINARY_DIR} DEPENDS @@ -456,6 +459,7 @@ if(ImpactX_PYTHON) add_custom_target(${ImpactX_CUSTOM_TARGET_PREFIX}pip_install_nodeps ${CMAKE_COMMAND} -E env IMPACTX_MPI=${ImpactX_MPI} ${Python_EXECUTABLE} -m pip ${PY_PIP_OPTIONS} install --force-reinstall --no-index --no-deps ${PY_PIP_INSTALL_OPTIONS} --find-links=impactx-whl impactx + COMMAND_EXPAND_LISTS VERBATIM WORKING_DIRECTORY ${ImpactX_BINARY_DIR} DEPENDS diff --git a/docs/source/install/cmake.rst b/docs/source/install/cmake.rst index 193fcbf2b..8fe5a85c7 100644 --- a/docs/source/install/cmake.rst +++ b/docs/source/install/cmake.rst @@ -112,8 +112,8 @@ CMake Option Default & Values Des ``ImpactX_PRECISION`` SINGLE/**DOUBLE** Floating point precision (single/double) ``ImpactX_PYTHON`` ON/**OFF** Python bindings ``Python_EXECUTABLE`` (newest found) Path to Python executable -``PY_PIP_OPTIONS`` ``-v`` Additional options for ``pip``, e.g., ``-vvv`` -``PY_PIP_INSTALL_OPTIONS`` Additional options for ``pip install``, e.g., ``--user`` +``PY_PIP_OPTIONS`` ``-v`` Additional options for ``pip``, e.g., ``-vvv;-q`` +``PY_PIP_INSTALL_OPTIONS`` Additional options for ``pip install``, e.g., ``--user;-q`` =============================== ============================================ =========================================================== ImpactX can be configured in further detail with options from AMReX, which are `documented in the AMReX manual `_.