buildPythonPackage: add support for setupPyGlobalFlags (2)
This commit is contained in:
committed by
Frederik Rietdijk
parent
e92a2f2fc2
commit
7da15d9b36
@@ -5,10 +5,12 @@
|
||||
}:
|
||||
|
||||
{
|
||||
# passed to "python setup.py build_ext"
|
||||
# Global options passed to "python setup.py"
|
||||
setupPyGlobalFlags ? []
|
||||
# Build options passed to "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
|
||||
options = lib.concatMapStringsSep " " (option: "--global-option ${option}") setupPyBuildFlags;
|
||||
pipGlobalFlagsString = lib.concatMapStringsSep " " (option: "--global-option ${option}") setupPyGlobalFlags;
|
||||
pipBuildFlagsString = lib.concatMapStringsSep " " (option: "--build-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 ${pipGlobalFlagsString} ${pipBuildFlagsString} .
|
||||
echo "Finished creating a wheel..."
|
||||
runHook postBuild
|
||||
'';
|
||||
@@ -50,4 +53,4 @@ in attrs // {
|
||||
${postShellHook}
|
||||
'';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user