summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/term-image/default.nix
blob: 04f5070108d4bac83738305e6eabfff7bc13044c (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  pillow,
  requests,
  urwid,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "term-image";
  version = "0.7.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "AnonymouX47";
    repo = "term-image";
    tag = "v${version}";
    hash = "sha256-uA04KHKLXW0lx1y5brpCDARLac4/C8VmVinVMkEtTdM=";
  };

  build-system = [
    setuptools
  ];

  dependencies = [
    requests
    pillow
  ];

  optional-dependencies = {
    urwid = [ urwid ];
  };

  pythonRelaxDeps = [ "pillow" ];

  nativeCheckInputs = [
    pytestCheckHook
  ]
  ++ optional-dependencies.urwid;

  disabledTestPaths = [
    # test_url needs online access
    "tests/test_image/test_url.py"
  ];

  pythonImportsCheck = [ "term_image" ];

  meta = {
    description = "Display images in the terminal with python";
    homepage = "https://github.com/AnonymouX47/term-image";
    changelog = "https://github.com/AnonymouX47/term-image/releases/tag/v${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ liff ];
  };
}