about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/autoslot/default.nix
blob: c234b35e0e585e26d68cf4d221edc401529c7303 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ lib
, buildPythonPackage
, fetchFromGitHub
, flit-core
, pytestCheckHook
, pythonOlder
}:

buildPythonPackage rec {
  pname = "autoslot";
  version = "2022.12.1";
  format = "pyproject";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "cjrh";
    repo = "autoslot";
    rev = "refs/tags/v${version}";
    hash = "sha256-fG4rRwRubJt2aXChEsMybEKal6LscZI7GA2uwtK5Vtg=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace 'requires = ["flit"]' 'requires = ["flit_core"]' \
      --replace 'build-backend = "flit.buildapi"' 'build-backend = "flit_core.buildapi"'
  '';

  nativeBuildInputs = [
    flit-core
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  pythonImportsCheck = [
    "autoslot"
  ];

  meta = with lib; {
    description = "Automatic __slots__ for your Python classes";
    homepage = "https://github.com/cjrh/autoslot";
    license = licenses.asl20;
    maintainers = with maintainers; [ fab ];
  };
}