Files
nixpkgs/pkgs/development/python-modules/attrs/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

60 lines
1.2 KiB
Nix

{
lib,
callPackage,
buildPythonPackage,
fetchPypi,
pythonOlder,
replaceVars,
hatchling,
}:
buildPythonPackage rec {
pname = "attrs";
version = "25.3.0";
disabled = pythonOlder "3.7";
format = "pyproject";
src = fetchPypi {
inherit pname version;
hash = "sha256-ddfO/H+1dnR7LIG0RC1NShzgkAlzUnwBHRAw/Tv0rxs=";
};
patches = [
(replaceVars ./remove-hatch-plugins.patch {
# hatch-vcs and hatch-fancy-pypi-readme depend on pytest, which depends on attrs
inherit version;
})
];
nativeBuildInputs = [ hatchling ];
outputs = [
"out"
"testout"
];
postInstall = ''
# Install tests as the tests output.
mkdir $testout
cp -R conftest.py tests $testout
'';
pythonImportsCheck = [ "attr" ];
# pytest depends on attrs, so we can't do this out-of-the-box.
# Instead, we do this as a passthru.tests test.
doCheck = false;
passthru.tests = {
pytest = callPackage ./tests.nix { };
};
meta = {
description = "Python attributes without boilerplate";
homepage = "https://github.com/python-attrs/attrs";
changelog = "https://github.com/python-attrs/attrs/releases/tag/${version}";
license = lib.licenses.mit;
maintainers = [ ];
};
}