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