summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/cutie/default.nix
blob: 60025fa60a4c03e5088b5a6ca68ab6b73afd3624 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools,

  # dependencies
  readchar,
  colorama,

  # tests
  pytestCheckHook,
}:

buildPythonPackage (finalAttrs: {
  pname = "cutie";
  version = "0.3.2";
  pyproject = true;
  __structuredAttrs = true;

  src = fetchFromGitHub {
    owner = "kamik423";
    repo = "cutie";
    tag = finalAttrs.version;
    hash = "sha256-Z9GNvTrCgb+EDqlhHcOjn78Pli0Uc1HuVN2FrjTQobs=";
  };

  # https://docs.python.org/3/whatsnew/3.12.html#whatsnew312-removed-imp
  postPatch = ''
    substituteInPlace setup.py \
      --replace-fail "import imp" "import types" \
      --replace-fail \
        'cutie = imp.new_module("cutie")' \
        'cutie = types.ModuleType("cutie")'
  '';

  build-system = [
    setuptools
  ];

  dependencies = [
    colorama
    readchar
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "cutie" ];

  meta = {
    description = "Command line User Tools for Input Easification";
    homepage = "https://github.com/kamik423/cutie";
    changelog = "https://github.com/kamik423/cutie/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [
      gigahawk
    ];
  };
})