1{ lib
2, aspell
3, aspellDicts
4, buildPythonPackage
5, fetchPypi
6, isPy27
7, pytestCheckHook
8, pythonAtLeast
9}:
10
11buildPythonPackage rec {
12 pname = "aspell-python";
13 version = "1.15";
14 format = "setuptools";
15
16 disabled = isPy27;
17
18 src = fetchPypi {
19 pname = "aspell-python-py3";
20 inherit version;
21 extension = "tar.bz2";
22 hash = "sha256-IEKRDmQY5fOH9bQk0dkUAy7UzpBOoZW4cNtVvLMcs40=";
23 };
24
25 buildInputs = [
26 aspell
27 ];
28
29 checkInputs = [
30 pytestCheckHook
31 ];
32
33 preCheck = ''
34 export ASPELL_CONF="dict-dir ${aspellDicts.en}/lib/aspell"
35 export HOME=$(mktemp -d)
36 '';
37
38 pytestFlagsArray = [
39 "test/unittests.py"
40 ];
41
42 disabledTests = lib.optionals (pythonAtLeast "3.10") [
43 # https://github.com/WojciechMula/aspell-python/issues/22
44 "test_add"
45 "test_get"
46 "test_saveall"
47 ];
48
49 pythonImportsCheck = [
50 "aspell"
51 ];
52
53 meta = with lib; {
54 description = "Python wrapper for aspell (C extension and Python version)";
55 homepage = "https://github.com/WojciechMula/aspell-python";
56 license = licenses.bsd3;
57 maintainers = with maintainers; [ SuperSandro2000 ];
58 };
59}