You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/languages-frameworks/python.section.md
+73-23Lines changed: 73 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -207,6 +207,62 @@ following are specific to `buildPythonPackage`:
207
207
*`setupPyGlobalFlags ? []`: List of flags passed to `setup.py` command.
208
208
*`setupPyBuildFlags ? []`: List of flags passed to `setup.py build_ext` command.
209
209
210
+
##### Using fixed-point arguments {#buildpythonpackage-fixed-point-arguments}
211
+
212
+
Both `buildPythonPackage` and `buildPythonApplication` support [fixed-point arguments](#chap-build-helpers-finalAttrs), similar to `stdenv.mkDerivation`.
213
+
This allows you to reference the final attributes of the derivation.
214
+
215
+
Instead of using `rec`:
216
+
217
+
```nix
218
+
buildPythonPackage rec {
219
+
pname = "pyspread";
220
+
version = "2.4";
221
+
src = fetchPypi {
222
+
inherit pname version;
223
+
hash = "sha256-...";
224
+
};
225
+
}
226
+
```
227
+
228
+
You can use the `finalAttrs` pattern:
229
+
230
+
```nix
231
+
buildPythonPackage (finalAttrs: {
232
+
pname = "pyspread";
233
+
version = "2.4";
234
+
src = fetchPypi {
235
+
pname = "pyspread";
236
+
inherit (finalAttrs) version;
237
+
hash = "sha256-...";
238
+
};
239
+
})
240
+
```
241
+
242
+
See the [general documentation on fixed-point arguments](#chap-build-helpers-finalAttrs) for more details on the benefits of this pattern.
243
+
244
+
::: {.note}
245
+
246
+
Some `buildPythonPackage`/`buildPythonApplication` arguments are passed down indirectly to `stdenv.mkDerivation` via `passthru`.
247
+
Therefore the final state of these attributes can be accessed via `finalAttrs.passthru.${name}`.
248
+
[`<pkg>.overrideAttrs`](#sec-pkg-overrideAttrs) can override them using the `passthru = prevAttrs.passthru // { foo = "bar"; }` pattern.
249
+
Such arguments include:
250
+
251
+
-`disabled`
252
+
-`pyproject`
253
+
-`format`
254
+
-`build-system`
255
+
-`dependencies`
256
+
-`optional-dependencies`
257
+
258
+
<!--
259
+
TODO(@doronbehar): When `.overridePythonAttrs` will be removed, the above text might need to be revised. See:
260
+
261
+
- https://github.com/NixOS/nixpkgs/pull/379637
262
+
- https://github.com/NixOS/nixpkgs/pull/469804
263
+
-->
264
+
:::
265
+
210
266
The [`stdenv.mkDerivation`](#sec-using-stdenv) function accepts various parameters for describing
211
267
build inputs (see "Specifying dependencies"). The following are of special
212
268
interest for Python packages, either because these are primarily used, or
@@ -237,29 +293,23 @@ the overrides for packages in the package set.
Copy file name to clipboardExpand all lines: doc/release-notes/rl-2605.section.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -269,6 +269,8 @@
269
269
270
270
- `opensmtpd-filter-dkimsign` is now installed into `libexec/smtpd` instead of `libexec/opensmtpd` so that now it is properly linked into the environment built by `services.opensmtpd.procPackages`. If you hardcoded path to `filter-dkimsign` please consider using this option.
271
271
272
+
- `shisho` has been removed because it's archived. `semgrep`, `opengrep`, and `ast-grep` provide similar functionality.
273
+
272
274
- `services.openssh.settings.AcceptEnv` now explicitly defined as an option that takes a list of strings, to facilitate option merging. Setting it to a string value is no longer supported.
273
275
274
276
- All Xfce packages have been moved to top level (e.g. if you previously added `pkgs.xfce.xfce4-whiskermenu-plugin` to `environment.systemPackages`, you will need to change it to `pkgs.xfce4-whiskermenu-plugin`). The `xfce` scope will be removed in NixOS 26.11.
0 commit comments