2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, callPackage
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "attrs";
|
2022-01-26 04:04:25 +00:00
|
|
|
version = "21.4.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-01-26 04:04:25 +00:00
|
|
|
hash = "sha256-YmuoI0IR25joad92IwoTfExAoS1yRFxF1fW3FvB24v0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
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
|
|
|
|
cp -R tests $testout/tests
|
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";
|
|
|
|
homepage = "https://github.com/hynek/attrs";
|
|
|
|
license = licenses.mit;
|
2022-01-26 04:04:25 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|