Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: document buildPython* stdenv overriding via <function>.override
Browse files Browse the repository at this point in the history
ShamrockLee committed Jan 22, 2025
1 parent b259def commit 6ced5d4
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/languages-frameworks/python.section.md
Original file line number Diff line number Diff line change
@@ -542,6 +542,10 @@ 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 most of the build helpers provided by Nixpkgs, most Python build helpers provide a `<function>.override` attributes. It works like [<pkg>.override](#sec-pkg-override), and can be used to override the dependencies of each build helper. Specifically, the `stdenv` used by `buildPythonPackage` and `buildPythonApplication`, which defaults to `python.stdenv`, can be overridden with `buildPythonPackage.override { stdenv = customStdenv; }` and `buildPythonApplication.override { stdenv = customStdenv; }`, respectively.

## User Guide {#user-guide}

### Using Python {#using-python}
3 changes: 3 additions & 0 deletions doc/redirects.json
Original file line number Diff line number Diff line change
@@ -3406,6 +3406,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"
],

0 comments on commit 6ced5d4

Please sign in to comment.