1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 flit-core, 6 pytestCheckHook, 7 pythonOlder, 8}: 9 10buildPythonPackage rec { 11 pname = "autoslot"; 12 version = "2022.12.1"; 13 format = "pyproject"; 14 15 disabled = pythonOlder "3.7"; 16 17 src = fetchFromGitHub { 18 owner = "cjrh"; 19 repo = "autoslot"; 20 rev = "refs/tags/v${version}"; 21 hash = "sha256-fG4rRwRubJt2aXChEsMybEKal6LscZI7GA2uwtK5Vtg="; 22 }; 23 24 postPatch = '' 25 substituteInPlace pyproject.toml \ 26 --replace 'requires = ["flit"]' 'requires = ["flit_core"]' \ 27 --replace 'build-backend = "flit.buildapi"' 'build-backend = "flit_core.buildapi"' 28 ''; 29 30 nativeBuildInputs = [ flit-core ]; 31 32 nativeCheckInputs = [ pytestCheckHook ]; 33 34 pythonImportsCheck = [ "autoslot" ]; 35 36 meta = with lib; { 37 description = "Automatic __slots__ for your Python classes"; 38 homepage = "https://github.com/cjrh/autoslot"; 39 license = licenses.asl20; 40 maintainers = with maintainers; [ fab ]; 41 }; 42}