DunePythonInstallPackage¶
Helpers for configuring and installing Python packages from the DUNE build system.
- dune_python_configure_dependencies¶
Install dependencies of a Python package at configure time.
dune_python_configure_dependencies( PATH <path> [RESULT <var>] [INSTALL_CONCRETE_DEPENDENCIES <value>] )
PATHPath to the package source directory containing a valid
setup.pyfile. Relative paths are evaluated with respect toCMAKE_CURRENT_SOURCE_DIR.RESULTVariable receiving the result of dependency configuration. A non-zero value indicates failure.
INSTALL_CONCRETE_DEPENDENCIESForce installation of the concrete dependencies listed in
requirements.txt.
Dependencies are extracted from
setup.pyandrequirements.txt. Failure during dependency installation does not trigger a fatal CMake error, but it is reflected inRESULT.
- dune_link_dune_py¶
Generate metadata that lets an installed Python package interact with dune-py.
dune_link_dune_py( PATH <path> INSTALL_TARGET <target> [CMAKE_METADATA_FLAGS <flags...>] )
PATHAbsolute path to the Python package source tree where metadata should be generated.
INSTALL_TARGETName of the target that generates the package metadata and triggers dune-py module configuration during installation.
CMAKE_METADATA_FLAGSExtra CMake flags written into the metadata file as
flag:=valuepairs.
The generated metadata is installed together with the package and is used by the Python bindings to transport CMake-side build information into the installed package. A module
dune-mymoduleproviding the packagedune.mymodulewould typically usedune/mymodule/metadata.cmakeas the metadata file path.
- dune_python_configure_package¶
Configure installation of a Python package at configure time.
dune_python_configure_package( PATH <path> [INSTALL_TARGET <target>] [RESULT <var>] [ADDITIONAL_PIP_PARAMS <param>...] [INSTALL_CONCRETE_DEPENDENCIES] )
PATHPath to the Python package. Relative paths are evaluated with respect to
CMAKE_CURRENT_SOURCE_DIR.INSTALL_TARGETTarget that installs the package into the configured install directory.
RESULTVariable receiving the result of package configuration.
ADDITIONAL_PIP_PARAMSExtra arguments appended to any
pip installinvocation.INSTALL_CONCRETE_DEPENDENCIESForwarded to
dune_python_configure_dependencies().
The package is installed to
DUNE_PYTHON_INSTALL_LOCATIONduringmake install_pythonandmake install. A wheel is also placed into the DUNE wheelhouse so installed and non-installed module stacks can be mixed.
- dune_python_configure_bindings¶
Convenience wrapper for configuring a Python package together with its dune-py metadata.
dune_python_configure_bindings( PATH <path> [PACKAGENAME <name>] [ADDITIONAL_PIP_PARAMS <param>...] [CMAKE_METADATA_FLAGS <flags...>] [REQUIRED] )
PATHRelative path to the Python package source directory.
PACKAGENAMEName of the Python package.
ADDITIONAL_PIP_PARAMSExtra arguments appended to any
pip installinvocation.CMAKE_METADATA_FLAGSExtra metadata flags written into the generated metadata file.
REQUIREDFail with a CMake error if the package cannot be installed. By default only a warning is emitted.
This command combines
dune_python_configure_dependencies(),dune_link_dune_py(), anddune_python_configure_package(). It also ensures that asetup.pyfile is available, either directly from the source tree, from a configuredsetup.py.in, or from a generated template.
- DUNE_PYTHON_ADDITIONAL_PIP_PARAMS¶
Additional pip flags used globally for the current build. This can be used, for example, to point pip to alternative package indices in restricted environments.