mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-01 05:19:17 +03:00
buildPythonPackage: add support for setupPyDistFlags
Flags passed to the "python setup.py" command.
This commit is contained in:
parent
4aee94629d
commit
1e0ebdb8a4
3 changed files with 14 additions and 5 deletions
|
@ -5,10 +5,12 @@
|
|||
}:
|
||||
|
||||
{
|
||||
# passed to "python setup.py"
|
||||
setupPyDistFlags ? []
|
||||
# passed to "python setup.py build_ext"
|
||||
# https://github.com/pypa/pip/issues/881
|
||||
# Rename to `buildOptions` because it is not setuptools specific?
|
||||
setupPyBuildFlags ? []
|
||||
, setupPyBuildFlags ? []
|
||||
# Execute before shell hook
|
||||
, preShellHook ? ""
|
||||
# Execute after shell hook
|
||||
|
@ -16,13 +18,14 @@
|
|||
, ... } @ attrs:
|
||||
|
||||
let
|
||||
installOptions = lib.concatMapStringsSep " " (option: "--install-option ${option}") setupPyDistFlags;
|
||||
options = lib.concatMapStringsSep " " (option: "--global-option ${option}") setupPyBuildFlags;
|
||||
in attrs // {
|
||||
buildPhase = attrs.buildPhase or ''
|
||||
runHook preBuild
|
||||
mkdir -p dist
|
||||
echo "Creating a wheel..."
|
||||
${python.pythonForBuild.interpreter} -m pip wheel --no-index --no-deps --no-clean --no-build-isolation --wheel-dir dist ${options} .
|
||||
${python.pythonForBuild.interpreter} -m pip wheel --no-index --no-deps --no-clean --no-build-isolation --wheel-dir dist ${installOptions} ${options} .
|
||||
echo "Finished creating a wheel..."
|
||||
runHook postBuild
|
||||
'';
|
||||
|
@ -50,4 +53,4 @@ in attrs // {
|
|||
${postShellHook}
|
||||
'';
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue