···982982#### Optional extra dependencies
983983984984Some packages define optional dependencies for additional features. With
985985-`setuptools` this is called `extras_require` and `flit` calls it `extras-require`. A
985985+`setuptools` this is called `extras_require` and `flit` calls it
986986+`extras-require`, while PEP 621 calls these `optional-dependencies`. A
986987method for supporting this is by declaring the extras of a package in its
987988`passthru`, e.g. in case of the package `dask`
988989989990```nix
990990-passthru.extras-require = {
991991+passthru.optional-dependencies = {
991992 complete = [ distributed ];
992993};
993994```
···997998```nix
998999propagatedBuildInputs = [
9991000 ...
10001000-] ++ dask.extras-require.complete;
10011001+] ++ dask.optional-dependencies.complete;
10011002```
1002100310031004Note this method is preferred over adding parameters to builders, as that can
···103103 return os.path.abspath(sys.argv[0] + "/../../../..")
104104105105106106-# For a package attribute and and an extra, check if the package exposes it via passthru.extras-require
106106+# For a package attribute and and an extra, check if the package exposes it via passthru.optional-dependencies
107107def has_extra(package: str, extra: str):
108108 cmd = [
109109 "nix-instantiate",
110110 repository_root(),
111111 "-A",
112112- f"{package}.extras-require.{extra}",
112112+ f"{package}.optional-dependencies.{extra}",
113113 ]
114114 try:
115115 subprocess.run(
···209209 attr_paths.append(pname)
210210 for extra in extras:
211211 # Check if package advertises extra requirements
212212- extra_attr = f"{pname}.extras-require.{extra}"
212212+ extra_attr = f"{pname}.optional-dependencies.{extra}"
213213 if has_extra(attr_path, extra):
214214 extra_attrs.append(extra_attr)
215215 else: