summary refs log tree commit diff
path: root/doc/languages-frameworks/python.section.md
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@protonmail.com>2022-02-26 21:04:25 -0300
committerAndersonTorres <torres.anderson.85@protonmail.com>2022-02-26 21:04:25 -0300
commited2b1b4b909538716abb6378971ba75fae65b7d2 (patch)
tree25c9f8f505f3ad7d3955c556a50ef6c111e7c369 /doc/languages-frameworks/python.section.md
parentf68dbdc7c39faa5f685e34b10da0b373ad6a7c22 (diff)
parent2970b27faf15840714feba50186e7e02d945569f (diff)
downloadnixpkgs-ed2b1b4b909538716abb6378971ba75fae65b7d2.tar
nixpkgs-ed2b1b4b909538716abb6378971ba75fae65b7d2.tar.gz
nixpkgs-ed2b1b4b909538716abb6378971ba75fae65b7d2.tar.bz2
nixpkgs-ed2b1b4b909538716abb6378971ba75fae65b7d2.tar.lz
nixpkgs-ed2b1b4b909538716abb6378971ba75fae65b7d2.tar.xz
nixpkgs-ed2b1b4b909538716abb6378971ba75fae65b7d2.tar.zst
nixpkgs-ed2b1b4b909538716abb6378971ba75fae65b7d2.zip
Merge branch 'master' into staging-next
Diffstat (limited to 'doc/languages-frameworks/python.section.md')
-rw-r--r--doc/languages-frameworks/python.section.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md
index 9f9ace513c3..693ea016e0a 100644
--- a/doc/languages-frameworks/python.section.md
+++ b/doc/languages-frameworks/python.section.md
@@ -979,6 +979,31 @@ with import <nixpkgs> {};
 in python.withPackages(ps: [ps.blaze])).env
 ```
 
+#### Optional extra dependencies
+
+Some packages define optional dependencies for additional features. With
+`setuptools` this is called `extras_require` and `flit` calls it `extras-require`. A
+method for supporting this is by declaring the extras of a package in its
+`passthru`, e.g. in case of the package `dask`
+
+```nix
+passthru.extras-require = {
+  complete = [ distributed ];
+};
+```
+
+and letting the package requiring the extra add the list to its dependencies
+
+```nix
+propagatedBuildInputs = [
+  ...
+] ++ dask.extras-require.complete;
+```
+
+Note this method is preferred over adding parameters to builders, as that can
+result in packages depending on different variants and thereby causing
+collisions.
+
 #### `buildPythonApplication` function {#buildpythonapplication-function}
 
 The `buildPythonApplication` function is practically the same as