mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
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:
parent
976cb96fe0
commit
0b0dd33e0a
@ -475,7 +475,6 @@ are used in [`buildPythonPackage`](#buildpythonpackage-function).
|
||||
See [example usage](#using-pythonrelaxdepshook).
|
||||
- `pythonRemoveBinBytecode` to remove bytecode from the `/bin` folder.
|
||||
- `setuptoolsBuildHook` to build a wheel using `setuptools`.
|
||||
- `setuptoolsCheckHook` to run tests with `python setup.py test`.
|
||||
- `sphinxHook` to build documentation and manpages using Sphinx.
|
||||
- `venvShellHook` to source a Python 3 `venv` at the `venvDir` location. A
|
||||
`venv` is created if it does not yet exist. `postVenvCreation` can be used to
|
||||
|
@ -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) ''
|
||||
|
Loading…
Reference in New Issue
Block a user