treewide: run treefmt with mdcr/nixfmt

This commit is contained in:
Wolfgang Walther
2025-07-22 16:14:50 +02:00
parent 6c47e7d5da
commit 62fe016519
195 changed files with 1919 additions and 2002 deletions

View File

@@ -126,9 +126,7 @@ buildPythonPackage rec {
pluggy
];
nativeCheckInputs = [
hypothesis
];
nativeCheckInputs = [ hypothesis ];
meta = {
changelog = "https://github.com/pytest-dev/pytest/releases/tag/${version}";
@@ -271,16 +269,8 @@ be used through out all of the Python package set:
python3MyBlas = pkgs.python3.override {
packageOverrides = self: super: {
# We need toPythonModule for the package set to evaluate this
blas = super.toPythonModule (
super.pkgs.blas.override {
blasProvider = super.pkgs.mkl;
}
);
lapack = super.toPythonModule (
super.pkgs.lapack.override {
lapackProvider = super.pkgs.mkl;
}
);
blas = super.toPythonModule (super.pkgs.blas.override { blasProvider = super.pkgs.mkl; });
lapack = super.toPythonModule (super.pkgs.lapack.override { lapackProvider = super.pkgs.mkl; });
};
};
}
@@ -323,9 +313,7 @@ python3Packages.buildPythonApplication rec {
hash = "sha256-Pe229rT0aHwA98s+nTHQMEFKZPo/yw6sot8MivFDvAw=";
};
build-system = with python3Packages; [
setuptools
];
build-system = with python3Packages; [ setuptools ];
dependencies = with python3Packages; [
tornado
@@ -357,9 +345,7 @@ the attribute in `python-packages.nix`, and the `toPythonApplication` shall be
applied to the reference:
```nix
{
python3Packages,
}:
{ python3Packages }:
python3Packages.toPythonApplication python3Packages.youtube-dl
```
@@ -395,9 +381,7 @@ mkPythonMetaPackage {
pname = "psycopg2-binary";
inherit (psycopg2) optional-dependencies version;
dependencies = [ psycopg2 ];
meta = {
inherit (psycopg2.meta) description homepage;
};
meta = { inherit (psycopg2.meta) description homepage; };
}
```
@@ -443,9 +427,7 @@ let
pythonEnv = myPython.withPackages (ps: [ ps.my-editable ]);
in
pkgs.mkShell {
packages = [ pythonEnv ];
}
pkgs.mkShell { packages = [ pythonEnv ]; }
```
#### `python.buildEnv` function {#python.buildenv-function}
@@ -942,9 +924,7 @@ buildPythonPackage rec {
hash = "sha256-CP3V73yWSArRHBLUct4hrNMjWZlvaaUlkpm1QP66RWA=";
};
build-system = [
setuptools
];
build-system = [ setuptools ];
# has no tests
doCheck = false;
@@ -1001,9 +981,7 @@ with import <nixpkgs> { };
hash = "sha256-CP3V73yWSArRHBLUct4hrNMjWZlvaaUlkpm1QP66RWA=";
};
build-system = [
python313.pkgs.setuptools
];
build-system = [ python313.pkgs.setuptools ];
# has no tests
doCheck = false;
@@ -1080,9 +1058,7 @@ buildPythonPackage rec {
hash = "sha256-FLLvdm1MllKrgTGC6Gb0k0deZeVYvtCCLji/B7uhong=";
};
build-system = [
setuptools
];
build-system = [ setuptools ];
dependencies = [
multipledispatch
@@ -1090,9 +1066,7 @@ buildPythonPackage rec {
python-dateutil
];
nativeCheckInputs = [
pytestCheckHook
];
nativeCheckInputs = [ pytestCheckHook ];
meta = {
changelog = "https://github.com/blaze/datashape/releases/tag/${version}";
@@ -1133,9 +1107,7 @@ buildPythonPackage rec {
hash = "sha256-s9NiusRxFydHzaNRMjjxFcvWxfi45jGb9ql6eJJyQJk=";
};
build-system = [
setuptools
];
build-system = [ setuptools ];
buildInputs = [
libxml2
@@ -1197,9 +1169,7 @@ buildPythonPackage rec {
hash = "sha256-9ru2r6kwhUCaskiFoaPNuJCfCVoUL01J40byvRt4kHQ=";
};
build-system = [
setuptools
];
build-system = [ setuptools ];
buildInputs = [
fftw
@@ -1307,11 +1277,7 @@ To use `pytestCheckHook`, add it to `nativeCheckInputs`.
Adding `pytest` is not required, since it is included with `pytestCheckHook`.
```nix
{
nativeCheckInputs = [
pytestCheckHook
];
}
{ nativeCheckInputs = [ pytestCheckHook ]; }
```
`pytestCheckHook` recognizes the following attributes:
@@ -1340,9 +1306,7 @@ The following example demonstrates usage of various `pytestCheckHook` attributes
```nix
{
nativeCheckInputs = [
pytestCheckHook
];
nativeCheckInputs = [ pytestCheckHook ];
# Allow running the following test paths and test objects.
enabledTestPaths = [
@@ -1402,9 +1366,7 @@ by disabling tests that match both `"Foo"` **and** `"bar"`:
{
__structuredAttrs = true;
disabledTests = [
"Foo and bar"
];
disabledTests = [ "Foo and bar" ];
}
```
@@ -1492,9 +1454,7 @@ we can do:
"pkg1"
"pkg3"
];
pythonRemoveDeps = [
"pkg2"
];
pythonRemoveDeps = [ "pkg2" ];
}
```
@@ -1509,9 +1469,7 @@ Another option is to pass `true`, that will relax/remove all dependencies, for
example:
```nix
{
pythonRelaxDeps = true;
}
{ pythonRelaxDeps = true; }
```
which would result in the following `requirements.txt` file:
@@ -1547,9 +1505,7 @@ automatically add `pythonRelaxDepsHook` if either `pythonRelaxDeps` or
```nix
{
nativeCheckInputs = [
unittestCheckHook
];
nativeCheckInputs = [ unittestCheckHook ];
unittestFlags = [
"-s"
@@ -1575,9 +1531,7 @@ render them using the default `html` style.
"doc"
];
nativeBuildInputs = [
sphinxHook
];
nativeBuildInputs = [ sphinxHook ];
}
```
@@ -1652,9 +1606,7 @@ buildPythonPackage rec {
hash = "sha256-CP3V73yWSArRHBLUct4hrNMjWZlvaaUlkpm1QP66RWA=";
};
build-system = [
setuptools
];
build-system = [ setuptools ];
meta = {
changelog = "https://github.com/pytoolz/toolz/releases/tag/${version}";
@@ -1717,14 +1669,10 @@ with import <nixpkgs> { };
});
};
in
pkgs.python310.override {
inherit packageOverrides;
};
pkgs.python310.override { inherit packageOverrides; };
in
python.withPackages (ps: [
ps.pandas
])
python.withPackages (ps: [ ps.pandas ])
).env
```
@@ -1743,16 +1691,9 @@ with import <nixpkgs> { };
(
let
packageOverrides = self: super: {
scipy = super.scipy_0_17;
};
packageOverrides = self: super: { scipy = super.scipy_0_17; };
in
(pkgs.python310.override {
inherit packageOverrides;
}).withPackages
(ps: [
ps.blaze
])
(pkgs.python310.override { inherit packageOverrides; }).withPackages (ps: [ ps.blaze ])
).env
```
@@ -2000,11 +1941,7 @@ this snippet:
```nix
{
myPythonPackages = python3Packages.override {
overrides = self: super: {
twisted = <...>;
};
};
myPythonPackages = python3Packages.override { overrides = self: super: { twisted = <...>; }; };
}
```