1{
2 lib,
3 fetchFromGitHub,
4 aspellDicts,
5 python3,
6}:
7
8python3.pkgs.buildPythonApplication rec {
9 pname = "codespell";
10 version = "2.4.1";
11 format = "pyproject";
12
13 src = fetchFromGitHub {
14 owner = "codespell-project";
15 repo = "codespell";
16 tag = "v${version}";
17 sha256 = "sha256-9hr/QZcBESLukujzNKNjWGG3nXx+wkvQvoUYmYgtXv0=";
18 };
19
20 nativeBuildInputs = with python3.pkgs; [
21 setuptools-scm
22 ];
23
24 nativeCheckInputs = with python3.pkgs; [
25 aspell-python
26 chardet
27 pytestCheckHook
28 pytest-cov-stub
29 pytest-dependency
30 ];
31
32 preCheck = ''
33 export ASPELL_CONF="dict-dir ${aspellDicts.en}/lib/aspell"
34 '';
35
36 disabledTests = [
37 # tries to run not fully installed script
38 "test_basic"
39 ];
40
41 pythonImportsCheck = [ "codespell_lib" ];
42
43 meta = with lib; {
44 description = "Fix common misspellings in source code";
45 mainProgram = "codespell";
46 homepage = "https://github.com/codespell-project/codespell";
47 license = with licenses; [
48 gpl2Only
49 cc-by-sa-30
50 ];
51 maintainers = with maintainers; [
52 johnazoidberg
53 SuperSandro2000
54 ];
55 };
56}