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