1{ lib 2, callPackage 3, buildPythonPackage 4, fetchPypi 5}: 6 7buildPythonPackage rec { 8 pname = "attrs"; 9 version = "21.4.0"; 10 11 src = fetchPypi { 12 inherit pname version; 13 hash = "sha256-YmuoI0IR25joad92IwoTfExAoS1yRFxF1fW3FvB24v0="; 14 }; 15 16 outputs = [ 17 "out" 18 "testout" 19 ]; 20 21 postInstall = '' 22 # Install tests as the tests output. 23 mkdir $testout 24 cp -R tests $testout/tests 25 ''; 26 27 pythonImportsCheck = [ 28 "attr" 29 ]; 30 31 # pytest depends on attrs, so we can't do this out-of-the-box. 32 # Instead, we do this as a passthru.tests test. 33 doCheck = false; 34 35 passthru.tests = { 36 pytest = callPackage ./tests.nix { }; 37 }; 38 39 meta = with lib; { 40 description = "Python attributes without boilerplate"; 41 homepage = "https://github.com/hynek/attrs"; 42 license = licenses.mit; 43 maintainers = with maintainers; [ ]; 44 }; 45}