2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, callPackage
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2022-08-21 13:32:41 +00:00
|
|
|
, pythonOlder
|
2023-10-09 19:29:22 +00:00
|
|
|
, hatchling
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "attrs";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "23.1.0";
|
|
|
|
disabled = pythonOlder "3.7";
|
2023-01-20 10:41:00 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-YnmDbVgVE6JvG/I1+azTM7yRFWg/FPfo+uRsmPxQ4BU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
patches = [
|
|
|
|
# hatch-vcs and hatch-fancy-pypi-readme depend on pytest, which depends on attrs
|
|
|
|
./remove-hatch-plugins.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteAllInPlace pyproject.toml
|
|
|
|
'';
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
nativeBuildInputs = [
|
2023-10-09 19:29:22 +00:00
|
|
|
hatchling
|
2023-01-20 10:41:00 +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
|
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";
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://github.com/python-attrs/attrs/releases/tag/${version}";
|
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
|
|
|
};
|
|
|
|
}
|