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