···101101buildPythonPackage rec {
102102 pname = "pytest";
103103 version = "3.3.1";
104104- format = "setuptools";
104104+ pyproject = true;
105105106106 src = fetchPypi {
107107 inherit pname version;
···167167* `dontWrapPythonPrograms ? false`: Skip wrapping of Python programs.
168168* `permitUserSite ? false`: Skip setting the `PYTHONNOUSERSITE` environment
169169 variable in wrapped programs.
170170-* `format ? "setuptools"`: Format of the source. Valid options are
171171- `"setuptools"`, `"pyproject"`, `"flit"`, `"wheel"`, and `"other"`.
172172- `"setuptools"` is for when the source has a `setup.py` and `setuptools` is
173173- used to build a wheel, `flit`, in case `flit` should be used to build a wheel,
174174- and `wheel` in case a wheel is provided. Use `other` when a custom
175175- `buildPhase` and/or `installPhase` is needed.
170170+* `pyproject`: Whether the pyproject format should be used. When set to `true`,
171171+ `pypaBuildHook` will be used, and you can add the required build dependencies
172172+ from `build-system.requires` to `nativeBuildInputs`. Note that the pyproject
173173+ format falls back to using `setuptools`, so you can use `pyproject = true`
174174+ even if the package only has a `setup.py`. When set to `false`, you can
175175+ use the existing [hooks](#setup-hooks0 or provide your own logic to build the
176176+ package. This can be useful for packages that don't support the pyproject
177177+ format. When unset, the legacy `setuptools` hooks are used for backwards
178178+ compatibility.
176179* `makeWrapperArgs ? []`: A list of strings. Arguments to be passed to
177180 `makeWrapper`, which wraps generated binaries. By default, the arguments to
178181 `makeWrapper` set `PATH` and `PYTHONPATH` environment variables before calling
···286289python3.pkgs.buildPythonApplication rec {
287290 pname = "luigi";
288291 version = "2.7.9";
289289- format = "setuptools";
292292+ pyproject = true;
290293291294 src = fetchPypi {
292295 inherit pname version;
293296 hash = "sha256-Pe229rT0aHwA98s+nTHQMEFKZPo/yw6sot8MivFDvAw=";
294297 };
295298299299+ nativeBuildInputs = [
300300+ python3.pkgs.setuptools
301301+ python3.pkgs.wheel
302302+ ];
303303+296304 propagatedBuildInputs = with python3.pkgs; [
297305 tornado
298306 python-daemon
299307 ];
300308301309 meta = with lib; {
302302- ...
310310+ # ...
303311 };
304312}
305313```
···858866{ lib
859867, buildPythonPackage
860868, fetchPypi
869869+, setuptools
870870+, wheel
861871}:
862872863873buildPythonPackage rec {
864874 pname = "toolz";
865875 version = "0.10.0";
866866- format = "setuptools";
876876+ pyproject = true;
867877868878 src = fetchPypi {
869879 inherit pname version;
870880 hash = "sha256-CP3V73yWSArRHBLUct4hrNMjWZlvaaUlkpm1QP66RWA=";
871881 };
882882+883883+ nativeBuildInputs = [
884884+ setuptools
885885+ wheel
886886+ ];
872887873888 # has no tests
874889 doCheck = false;
···918933 my_toolz = python311.pkgs.buildPythonPackage rec {
919934 pname = "toolz";
920935 version = "0.10.0";
921921- format = "setuptools";
936936+ pyproject = true;
922937923938 src = fetchPypi {
924939 inherit pname version;
925940 hash = "sha256-CP3V73yWSArRHBLUct4hrNMjWZlvaaUlkpm1QP66RWA=";
926941 };
942942+943943+ nativeBuildInputs = [
944944+ python311.pkgs.setuptools
945945+ python311.pkgs.wheel
946946+ ];
927947928948 # has no tests
929949 doCheck = false;
···972992, buildPythonPackage
973993, fetchPypi
974994995995+# build dependencies
996996+, setuptools, wheel
997997+975998# dependencies
976999, numpy, multipledispatch, python-dateutil
9771000···9821005buildPythonPackage rec {
9831006 pname = "datashape";
9841007 version = "0.4.7";
985985- format = "setuptools";
10081008+ pyproject = true;
98610099871010 src = fetchPypi {
9881011 inherit pname version;
9891012 hash = "sha256-FLLvdm1MllKrgTGC6Gb0k0deZeVYvtCCLji/B7uhong=";
9901013 };
10141014+10151015+ nativeBuildInputs = [
10161016+ setuptools
10171017+ wheel
10181018+ ];
99110199921020 propagatedBuildInputs = [
9931021 multipledispatch
···10231051{ lib
10241052, buildPythonPackage
10251053, fetchPypi
10541054+, setuptools
10551055+, wheel
10261056, libxml2
10271057, libxslt
10281058}:
···10301060buildPythonPackage rec {
10311061 pname = "lxml";
10321062 version = "3.4.4";
10331033- format = "setuptools";
10631063+ pyproject = true;
1034106410351065 src = fetchPypi {
10361066 inherit pname version;
10371067 hash = "sha256-s9NiusRxFydHzaNRMjjxFcvWxfi45jGb9ql6eJJyQJk=";
10381068 };
10691069+10701070+ nativeBuildInputs = [
10711071+ setuptools
10721072+ wheel
10731073+ ];
1039107410401075 buildInputs = [
10411076 libxml2
···10661101{ lib
10671102, buildPythonPackage
10681103, fetchPypi
11041104+11051105+# build dependencies
11061106+, setuptools
11071107+, wheel
1069110810701109# dependencies
10711110, fftw
···10781117buildPythonPackage rec {
10791118 pname = "pyFFTW";
10801119 version = "0.9.2";
10811081- format = "setuptools";
11201120+ pyproject = true;
1082112110831122 src = fetchPypi {
10841123 inherit pname version;
10851124 hash = "sha256-9ru2r6kwhUCaskiFoaPNuJCfCVoUL01J40byvRt4kHQ=";
10861125 };
11261126+11271127+ nativeBuildInputs = [
11281128+ setuptools
11291129+ wheel
11301130+ ];
1087113110881132 buildInputs = [
10891133 fftw
···1334137813351379Keep in mind that while the examples above are done with `requirements.txt`,
13361380`pythonRelaxDepsHook` works by modifying the resulting wheel file, so it should
13371337-work in any of the formats supported by `buildPythonPackage` currently,
13381338-with the exception of `other` (see `format` in
13391339-[`buildPythonPackage` parameters](#buildpythonpackage-parameters) for more details).
13811381+work with any of the existing [hooks](#setup-hooks).
1340138213411383#### Using unittestCheckHook {#using-unittestcheckhook}
13421384···14611503```nix
14621504{ lib
14631505, buildPythonPackage
15061506+, fetchPypi
15071507+, setuptools
15081508+, wheel
14641509}:
1465151014661511buildPythonPackage rec {
14671512 pname = "toolz";
14681513 version = "0.10.0";
14691469- format = "setuptools";
15141514+ pyproject = true;
1470151514711516 src = fetchPypi {
14721517 inherit pname version;
14731518 hash = "sha256-CP3V73yWSArRHBLUct4hrNMjWZlvaaUlkpm1QP66RWA=";
14741519 };
15201520+15211521+ nativeBuildInputs = [
15221522+ setuptools
15231523+ wheel
15241524+ ];
1475152514761526 meta = with lib; {
14771527 changelog = "https://github.com/pytoolz/toolz/releases/tag/${version}";