about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/interpreters/python/build-python-package-flit.nix
blob: b0f9e0380211705b00dbd02fb2464fdbe6489c8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# This function provides specific bits for building a flit-based Python package.

{ python
, flit
}:

{ ... } @ attrs:

attrs // {
  nativeBuildInputs = [ flit ];
  buildPhase = attrs.buildPhase or ''
    runHook preBuild
    flit build --format wheel
    runHook postBuild
  '';

  # Flit packages, like setuptools packages, might have tests.
  installCheckPhase = attrs.checkPhase or ''
    ${python.interpreter} -m unittest discover
  '';
  doCheck = attrs.doCheck or true;
}