treewide: run nixfmt 1.0.0

This commit is contained in:
Wolfgang Walther
2025-07-24 13:55:40 +02:00
parent 6f5663940c
commit 5a0711127c
5118 changed files with 98809 additions and 101507 deletions
@@ -277,86 +277,85 @@ let
inherit catchConflicts;
nativeBuildInputs =
[
python
wrapPython
ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)?
pythonRemoveTestsDirHook
]
++ optionals (finalAttrs.catchConflicts && !isBootstrapPackage && !isSetuptoolsDependency) [
#
# 1. When building a package that is also part of the bootstrap chain, we
# must ignore conflicts after installation, because there will be one with
# the package in the bootstrap.
#
# 2. When a package is a dependency of setuptools, we must ignore conflicts
# because the hook that checks for conflicts uses setuptools.
#
pythonCatchConflictsHook
]
++ optionals (attrs ? pythonRelaxDeps || attrs ? pythonRemoveDeps) [
pythonRelaxDepsHook
]
++ optionals removeBinBytecode [
pythonRemoveBinBytecodeHook
]
++ optionals (hasSuffix "zip" (attrs.src.name or "")) [
unzip
]
++ optionals (format' == "setuptools") [
setuptoolsBuildHook
]
++ optionals (format' == "pyproject") [
(
if isBootstrapPackage then
pypaBuildHook.override {
inherit (python.pythonOnBuildForHost.pkgs.bootstrap) build;
wheel = null;
}
else
pypaBuildHook
)
(
if isBootstrapPackage then
pythonRuntimeDepsCheckHook.override {
inherit (python.pythonOnBuildForHost.pkgs.bootstrap) packaging;
}
else
pythonRuntimeDepsCheckHook
)
]
++ optionals (format' == "wheel") [
wheelUnpackHook
]
++ optionals (format' == "egg") [
eggUnpackHook
eggBuildHook
eggInstallHook
]
++ optionals (format' != "other") [
(
if isBootstrapInstallPackage then
pypaInstallHook.override {
inherit (python.pythonOnBuildForHost.pkgs.bootstrap) installer;
}
else
pypaInstallHook
)
]
++ optionals (stdenv.buildPlatform == stdenv.hostPlatform) [
# This is a test, however, it should be ran independent of the checkPhase and checkInputs
pythonImportsCheckHook
]
++ optionals (python.pythonAtLeast "3.3") [
# Optionally enforce PEP420 for python3
pythonNamespacesHook
]
++ optionals withDistOutput [
pythonOutputDistHook
]
++ nativeBuildInputs
++ build-system;
nativeBuildInputs = [
python
wrapPython
ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)?
pythonRemoveTestsDirHook
]
++ optionals (finalAttrs.catchConflicts && !isBootstrapPackage && !isSetuptoolsDependency) [
#
# 1. When building a package that is also part of the bootstrap chain, we
# must ignore conflicts after installation, because there will be one with
# the package in the bootstrap.
#
# 2. When a package is a dependency of setuptools, we must ignore conflicts
# because the hook that checks for conflicts uses setuptools.
#
pythonCatchConflictsHook
]
++ optionals (attrs ? pythonRelaxDeps || attrs ? pythonRemoveDeps) [
pythonRelaxDepsHook
]
++ optionals removeBinBytecode [
pythonRemoveBinBytecodeHook
]
++ optionals (hasSuffix "zip" (attrs.src.name or "")) [
unzip
]
++ optionals (format' == "setuptools") [
setuptoolsBuildHook
]
++ optionals (format' == "pyproject") [
(
if isBootstrapPackage then
pypaBuildHook.override {
inherit (python.pythonOnBuildForHost.pkgs.bootstrap) build;
wheel = null;
}
else
pypaBuildHook
)
(
if isBootstrapPackage then
pythonRuntimeDepsCheckHook.override {
inherit (python.pythonOnBuildForHost.pkgs.bootstrap) packaging;
}
else
pythonRuntimeDepsCheckHook
)
]
++ optionals (format' == "wheel") [
wheelUnpackHook
]
++ optionals (format' == "egg") [
eggUnpackHook
eggBuildHook
eggInstallHook
]
++ optionals (format' != "other") [
(
if isBootstrapInstallPackage then
pypaInstallHook.override {
inherit (python.pythonOnBuildForHost.pkgs.bootstrap) installer;
}
else
pypaInstallHook
)
]
++ optionals (stdenv.buildPlatform == stdenv.hostPlatform) [
# This is a test, however, it should be ran independent of the checkPhase and checkInputs
pythonImportsCheckHook
]
++ optionals (python.pythonAtLeast "3.3") [
# Optionally enforce PEP420 for python3
pythonNamespacesHook
]
++ optionals withDistOutput [
pythonOutputDistHook
]
++ nativeBuildInputs
++ build-system;
buildInputs = validatePythonMatches "buildInputs" (buildInputs ++ pythonPath);
@@ -396,36 +395,36 @@ let
outputs = outputs ++ optional withDistOutput "dist";
passthru =
{
inherit disabled;
}
// {
updateScript =
let
filename = head (splitString ":" finalAttrs.finalPackage.meta.position);
in
[
update-python-libraries
filename
];
}
// optionalAttrs (dependencies != [ ]) {
inherit dependencies;
}
// optionalAttrs (optional-dependencies != { }) {
inherit optional-dependencies;
}
// optionalAttrs (build-system != [ ]) {
inherit build-system;
}
// attrs.passthru or { };
passthru = {
inherit disabled;
}
// {
updateScript =
let
filename = head (splitString ":" finalAttrs.finalPackage.meta.position);
in
[
update-python-libraries
filename
];
}
// optionalAttrs (dependencies != [ ]) {
inherit dependencies;
}
// optionalAttrs (optional-dependencies != { }) {
inherit optional-dependencies;
}
// optionalAttrs (build-system != [ ]) {
inherit build-system;
}
// attrs.passthru or { };
meta = {
# default to python's platforms
platforms = python.meta.platforms;
isBuildPythonPackage = python.meta.platforms;
} // meta;
}
// meta;
}
// optionalAttrs (attrs ? checkPhase) {
# If given use the specified checkPhase, otherwise use the setup hook.