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