nixpkgs/pkgs/development/tools/codespell/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.4 KiB
Nix
Raw Normal View History

{ lib
, fetchFromGitHub
, aspellDicts
, python3
}:
2020-11-29 17:27:55 +00:00
python3.pkgs.buildPythonApplication rec {
2019-08-07 21:04:48 +00:00
pname = "codespell";
version = "2.2.2";
format = "pyproject";
2019-08-07 21:04:48 +00:00
2021-02-12 19:14:54 +00:00
src = fetchFromGitHub {
owner = "codespell-project";
repo = "codespell";
rev = "v${version}";
sha256 = "sha256-zXHqaZzGIS7BOFc/kPzA4sgpoEmXuaKHdOcKpMWWeOI=";
2019-08-07 21:04:48 +00:00
};
postPatch = ''
substituteInPlace setup.cfg \
--replace "--cov=codespell_lib" "" \
--replace "--cov-report=" ""
'';
nativeBuildInputs = with python3.pkgs; [
setuptools-scm
];
nativeCheckInputs = with python3.pkgs; [
aspell-python
chardet
pytestCheckHook
pytest-dependency
];
2021-02-12 19:14:54 +00:00
SETUPTOOLS_SCM_PRETEND_VERSION = version;
2021-02-12 19:14:54 +00:00
preCheck = ''
export ASPELL_CONF="dict-dir ${aspellDicts.en}/lib/aspell"
2019-08-07 21:04:48 +00:00
'';
disabledTests = [
# tries to run not fully installed script
"test_command"
# error 'dateset' should not be in aspell dictionaries (en, en_GB, en_US, en_CA, en_AU) for dictionary /build/source/codespell_lib/tests/../data/dictionary.txt
"test_dictionary_formatting"
];
2021-02-12 19:14:54 +00:00
2020-11-29 17:27:55 +00:00
pythonImportsCheck = [ "codespell_lib" ];
2021-02-12 19:14:54 +00:00
meta = with lib; {
2019-08-07 21:04:48 +00:00
description = "Fix common misspellings in source code";
homepage = "https://github.com/codespell-project/codespell";
2021-02-12 19:14:54 +00:00
license = with licenses; [ gpl2Only cc-by-sa-30 ];
maintainers = with maintainers; [ johnazoidberg SuperSandro2000 ];
2019-08-07 21:04:48 +00:00
};
}