nixpkgs-suyu/pkgs/development/interpreters/python/build-python-package-flit.nix

23 lines
473 B
Nix
Raw Normal View History

2016-12-03 13:04:52 +01:00
# This function provides specific bits for building a flit-based Python package.
2017-02-01 14:26:27 +01:00
{ python
, flit
2016-12-03 13:04:52 +01:00
}:
{ ... } @ attrs:
attrs // {
buildInputs = [ flit ];
buildPhase = attrs.buildPhase or ''
runHook preBuild
2018-04-08 08:32:47 +02:00
flit build --format wheel
2016-12-03 13:04:52 +01:00
runHook postBuild
'';
2017-02-01 14:26:27 +01:00
# Flit packages, like setuptools packages, might have tests.
installCheckPhase = attrs.checkPhase or ''
${python.interpreter} -m unittest discover
'';
doCheck = attrs.doCheck or true;
}