about summary refs log tree commit diff
path: root/pkgs/development/python-modules/aspell-python/default.nix
blob: 1af34b43fc2910bd62eae7809dd0d9e477418606 (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
48
49
50
51
52
53
54
55
56
57
58
59
{ lib
, aspell
, aspellDicts
, buildPythonPackage
, fetchPypi
, isPy27
, pytestCheckHook
, pythonAtLeast
}:

buildPythonPackage rec {
  pname = "aspell-python";
  version = "1.15";
  format = "setuptools";

  disabled = isPy27;

  src = fetchPypi {
    pname = "aspell-python-py3";
    inherit version;
    extension = "tar.bz2";
    hash = "sha256-IEKRDmQY5fOH9bQk0dkUAy7UzpBOoZW4cNtVvLMcs40=";
  };

  buildInputs = [
    aspell
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  preCheck = ''
    export ASPELL_CONF="dict-dir ${aspellDicts.en}/lib/aspell"
    export HOME=$(mktemp -d)
  '';

  pytestFlagsArray = [
    "test/unittests.py"
  ];

  disabledTests = lib.optionals (pythonAtLeast "3.10") [
    # https://github.com/WojciechMula/aspell-python/issues/22
    "test_add"
    "test_get"
    "test_saveall"
  ];

  pythonImportsCheck = [
    "aspell"
  ];

  meta = with lib; {
    description = "Python wrapper for aspell (C extension and Python version)";
    homepage = "https://github.com/WojciechMula/aspell-python";
    license = licenses.bsd3;
    maintainers = with maintainers; [ ];
  };
}