2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, callPackage
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2022-08-21 13:32:41 +00:00
|
|
|
, pythonOlder
|
2023-01-20 10:41:00 +00:00
|
|
|
, setuptools
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "attrs";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "22.2.0";
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-01-20 10:41:00 +00:00
|
|
|
hash = "sha256-ySJ7/C8BmTwD9o2zfR0VyWkBiDI8BnxkHxo1ylgYX5k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"testout"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
postInstall = ''
|
|
|
|
# Install tests as the tests output.
|
|
|
|
mkdir $testout
|
2023-01-20 10:41:00 +00:00
|
|
|
cp -R conftest.py tests $testout
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"attr"
|
|
|
|
];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
# pytest depends on attrs, so we can't do this out-of-the-box.
|
|
|
|
# Instead, we do this as a passthru.tests test.
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
passthru.tests = {
|
|
|
|
pytest = callPackage ./tests.nix { };
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python attributes without boilerplate";
|
2022-08-21 13:32:41 +00:00
|
|
|
homepage = "https://github.com/python-attrs/attrs";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2022-01-26 04:04:25 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|