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