doc: document buildPython* stdenv overriding via <function>.override
This commit is contained in:
@@ -557,6 +557,19 @@ are used in [`buildPythonPackage`](#buildpythonpackage-function).
|
||||
with the `pipInstallHook`.
|
||||
- `unittestCheckHook` will run tests with `python -m unittest discover`. See [example usage](#using-unittestcheckhook).
|
||||
|
||||
#### Overriding build helpers {#overriding-python-build-helpers}
|
||||
|
||||
Like many of the build helpers provided by Nixpkgs, Python build helpers typically provide a `<function>.override` attribute.
|
||||
It works like [`<pkg>.override`](#sec-pkg-override), and can be used to override the dependencies of each build helper.
|
||||
|
||||
This allows specifying the stdenv to be used by `buildPythonPackage` or `buildPythonApplication`. The default (`python.stdenv`) can be overridden as follows:
|
||||
|
||||
```nix
|
||||
buildPythonPackage.override { stdenv = customStdenv; } {
|
||||
# package attrs...
|
||||
}
|
||||
```
|
||||
|
||||
## User Guide {#user-guide}
|
||||
|
||||
### Using Python {#using-python}
|
||||
|
||||
@@ -3807,6 +3807,9 @@
|
||||
"buildpythonpackage-parameters": [
|
||||
"index.html#buildpythonpackage-parameters"
|
||||
],
|
||||
"overriding-python-build-helpers": [
|
||||
"index.html#overriding-python-build-helpers"
|
||||
],
|
||||
"overriding-python-packages": [
|
||||
"index.html#overriding-python-packages"
|
||||
],
|
||||
|
||||
@@ -314,6 +314,10 @@
|
||||
|
||||
- `emacs` now disables the GC mark trace buffer by default. This improves GC performance by 5%, but can make GC issues harder to debug. This is configurable with `withGcMarkTrace`.
|
||||
|
||||
- Passing `stdenv` to `buildPythonPackage` or `buildPythonApplication` has been deprecated and will trigger an error in a future release.
|
||||
Instead, you should _override_ the python build helper, e.g., `(buildPythonPackage.override { stdenv = customStdenv; })`.
|
||||
See [](#overriding-python-build-helpers).
|
||||
|
||||
- `buildPythonPackage` and `buildPythonApplication` now default to `nix-update-script` as their default `updateScript`. This should improve automated updates, since nix-update is better maintained than the in-tree update script and has more robust fetcher support.
|
||||
|
||||
- `plasma6`: Fixed the `ksycoca` cache not being re-built when `$XDG_CACHE_HOME` is set to something that isn't `$HOME/.cache`.
|
||||
|
||||
Reference in New Issue
Block a user