1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, flit-core
6, pytestCheckHook
7}:
8
9buildPythonPackage rec {
10 pname = "testpath";
11 version = "0.6.0";
12 format = "pyproject";
13
14 src = fetchPypi {
15 inherit pname version;
16 hash = "sha256-LxuX5kQsAmgevgG9hPUxAop8rqGvOCUAD1I0XDAoXg8=";
17 };
18
19 nativeBuildInputs = [
20 flit-core
21 ];
22
23 nativeCheckInputs = [
24 pytestCheckHook
25 ];
26
27 # exe are only required when testpath is used on windows
28 # https://github.com/jupyter/testpath/blob/de8ca59539eb23b9781e55848b7d2646c8c61df9/testpath/commands.py#L128
29 preBuild = lib.optionalString (!stdenv.hostPlatform.isWindows) ''
30 rm testpath/cli-32.exe testpath/cli-64.exe
31 '';
32
33 preCheck = lib.optionalString stdenv.isDarwin ''
34 # Work around https://github.com/jupyter/testpath/issues/24
35 export TMPDIR="/tmp"
36 '';
37
38 meta = with lib; {
39 description = "Test utilities for code working with files and commands";
40 license = licenses.mit;
41 homepage = "https://github.com/jupyter/testpath";
42 };
43
44}