python312Packages.setuptoolsCheckHook: remove

The hook relied on the `test` command passed to `setup.py`, which has
long been deprecated and finally removed in setuptools 72.0.
This commit is contained in:
Martin Weinelt
2024-08-06 18:18:40 +02:00
parent 976cb96fe0
commit 0b0dd33e0a
7 changed files with 3 additions and 67 deletions
@@ -200,14 +200,7 @@ in {
};
} ./setuptools-build-hook.sh) {};
setuptoolsCheckHook = callPackage ({ makePythonHook, setuptools }:
makePythonHook {
name = "setuptools-check-hook";
propagatedBuildInputs = [ setuptools ];
substitutions = {
inherit pythonCheckInterpreter setuppy;
};
} ./setuptools-check-hook.sh) {};
setuptoolsCheckHook = throw "The setuptoolsCheckHook has been removed, since the test command has been removed in setuptools 72.0";
setuptoolsRustBuildHook = callPackage ({ makePythonHook, setuptools-rust }:
makePythonHook {
@@ -59,16 +59,4 @@ function pytestCheckPhase() {
if [ -z "${dontUsePytestCheck-}" ] && [ -z "${installCheckPhase-}" ]; then
echo "Using pytestCheckPhase"
preDistPhases+=" pytestCheckPhase"
# It's almost always the case that setuptoolsCheckPhase should not be ran
# when the pytestCheckHook is being ran
if [ -z "${useSetuptoolsCheck-}" ]; then
dontUseSetuptoolsCheck=1
# Remove command if already injected into preDistPhases
if [[ "$preDistPhases" =~ "setuptoolsCheckPhase" ]]; then
echo "Removing setuptoolsCheckPhase"
preDistPhases=${preDistPhases/setuptoolsCheckPhase/}
fi
fi
fi
@@ -1,18 +0,0 @@
# Setup hook for setuptools.
echo "Sourcing setuptools-check-hook"
setuptoolsCheckPhase() {
echo "Executing setuptoolsCheckPhase"
runHook preCheck
cp -f @setuppy@ nix_run_setup
@pythonCheckInterpreter@ nix_run_setup test
runHook postCheck
echo "Finished executing setuptoolsCheckPhase"
}
if [ -z "${dontUseSetuptoolsCheck-}" ] && [ -z "${installCheckPhase-}" ]; then
echo "Using setuptoolsCheckPhase"
preDistPhases+=" setuptoolsCheckPhase"
fi
@@ -14,16 +14,4 @@ unittestCheckPhase() {
if [ -z "${dontUseUnittestCheck-}" ] && [ -z "${installCheckPhase-}" ]; then
echo "Using unittestCheckPhase"
preDistPhases+=" unittestCheckPhase"
# It's almost always the case that setuptoolsCheckPhase should not be ran
# when the unittestCheckHook is being ran
if [ -z "${useSetuptoolsCheck-}" ]; then
dontUseSetuptoolsCheck=1
# Remove command if already injected into preDistPhases
if [[ "$preDistPhases" =~ "setuptoolsCheckPhase" ]]; then
echo "Removing setuptoolsCheckPhase"
preDistPhases=${preDistPhases/setuptoolsCheckPhase/}
fi
fi
fi
@@ -22,7 +22,6 @@
, pythonRemoveTestsDirHook
, pythonRuntimeDepsCheckHook
, setuptoolsBuildHook
, setuptoolsCheckHook
, wheelUnpackHook
, eggUnpackHook
, eggBuildHook
@@ -313,13 +312,7 @@ let
# Python packages don't have a checkPhase, only an installCheckPhase
doCheck = false;
doInstallCheck = attrs.doCheck or true;
nativeInstallCheckInputs = [
] ++ optionals (format' == "setuptools") [
# Longer-term we should get rid of this and require
# users of this function to set the `installCheckPhase` or
# pass in a hook that sets it.
setuptoolsCheckHook
] ++ nativeCheckInputs;
nativeInstallCheckInputs = nativeCheckInputs;
installCheckInputs = checkInputs;
postFixup = optionalString (!dontWrapPythonPrograms) ''
@@ -19,7 +19,6 @@
, pythonRemoveBinBytecodeHook
, pythonRemoveTestsDirHook
, setuptoolsBuildHook
, setuptoolsCheckHook
, wheelUnpackHook
, eggUnpackHook
, eggBuildHook
@@ -210,13 +209,7 @@ let
# Python packages don't have a checkPhase, only an installCheckPhase
doCheck = false;
doInstallCheck = attrs.doCheck or true;
nativeInstallCheckInputs = [
] ++ lib.optionals (format == "setuptools") [
# Longer-term we should get rid of this and require
# users of this function to set the `installCheckPhase` or
# pass in a hook that sets it.
setuptoolsCheckHook
] ++ nativeCheckInputs;
nativeInstallCheckInputs = nativeCheckInputs;
installCheckInputs = checkInputs;
postFixup = lib.optionalString (!dontWrapPythonPrograms) ''