2022-10-21 18:38:19 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2022-10-30 15:09:59 +00:00
|
|
|
, aspellDicts
|
|
|
|
, python3
|
2022-10-21 18:38:19 +00:00
|
|
|
}:
|
2020-12-07 07:45:13 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "codespell";
|
2024-06-24 18:47:55 +00:00
|
|
|
version = "2.3.0";
|
2022-10-30 15:09:59 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "codespell-project";
|
|
|
|
repo = "codespell";
|
|
|
|
rev = "v${version}";
|
2024-06-24 18:47:55 +00:00
|
|
|
sha256 = "sha256-X3Pueu0E7Q57sbKSXqCZki4/PUb1WyWk/Zmj+lhVTM8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
2023-03-15 16:39:30 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
2022-06-16 17:23:12 +00:00
|
|
|
--replace "--cov=codespell_lib" "" \
|
|
|
|
--replace "--cov-report=" ""
|
|
|
|
'';
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
nativeBuildInputs = with python3.pkgs; [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = with python3.pkgs; [
|
2022-10-21 18:38:19 +00:00
|
|
|
aspell-python
|
|
|
|
chardet
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-dependency
|
|
|
|
];
|
2021-02-13 14:23:35 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export ASPELL_CONF="dict-dir ${aspellDicts.en}/lib/aspell"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
disabledTests = [
|
|
|
|
# tries to run not fully installed script
|
2024-06-24 18:47:55 +00:00
|
|
|
"test_basic"
|
2022-08-21 13:32:41 +00:00
|
|
|
];
|
2021-02-13 14:23:35 +00:00
|
|
|
|
2020-12-07 07:45:13 +00:00
|
|
|
pythonImportsCheck = [ "codespell_lib" ];
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Fix common misspellings in source code";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "codespell";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/codespell-project/codespell";
|
2021-02-13 14:23:35 +00:00
|
|
|
license = with licenses; [ gpl2Only cc-by-sa-30 ];
|
|
|
|
maintainers = with maintainers; [ johnazoidberg SuperSandro2000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|