File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -979,6 +979,31 @@ with import <nixpkgs> {};
979979in python.withPackages(ps: [ps.blaze])).env
980980```
981981
982+ #### Optional extra dependencies
983+
984+ Some packages define optional dependencies for additional features. With
985+ ` setuptools ` this is called ` extras_require ` and ` flit ` calls it ` extras-require ` . A
986+ method for supporting this is by declaring the extras of a package in its
987+ ` passthru ` , e.g. in case of the package ` dask `
988+
989+ ``` nix
990+ passthru.extras-require = {
991+ complete = [ distributed ];
992+ };
993+ ```
994+
995+ and letting the package requiring the extra add the list to its dependencies
996+
997+ ``` nix
998+ propagatedBuildInputs = [
999+ ...
1000+ ] ++ dask.extras-require.complete;
1001+ ```
1002+
1003+ Note this method is preferred over adding parameters to builders, as that can
1004+ result in packages depending on different variants and thereby causing
1005+ collisions.
1006+
9821007#### ` buildPythonApplication ` function {#buildpythonapplication-function}
9831008
9841009The ` buildPythonApplication ` function is practically the same as
You can’t perform that action at this time.
0 commit comments