2022-10-02 16:05:42 +00:00
{ lib
, fetchFromGitHub
, aspellDicts
, python3
} :
2020-11-29 17:27:55 +00:00
2022-10-02 16:05:42 +00:00
python3 . pkgs . buildPythonApplication rec {
2019-08-07 21:04:48 +00:00
pname = " c o d e s p e l l " ;
2022-10-14 22:08:30 +00:00
version = " 2 . 2 . 2 " ;
2022-10-19 03:24:28 +00:00
format = " p y p r o j e c t " ;
2019-08-07 21:04:48 +00:00
2021-02-12 19:14:54 +00:00
src = fetchFromGitHub {
owner = " c o d e s p e l l - p r o j e c t " ;
repo = " c o d e s p e l l " ;
rev = " v ${ version } " ;
2022-10-14 22:08:30 +00:00
sha256 = " s h a 2 5 6 - z X H q a Z z G I S 7 B O F c / k P z A 4 s g p o E m X u a K H d O c K p M W W e O I = " ;
2019-08-07 21:04:48 +00:00
} ;
2022-05-30 04:26:22 +00:00
postPatch = ''
substituteInPlace setup . cfg \
- - replace " - - c o v = c o d e s p e l l _ l i b " " " \
- - replace " - - c o v - r e p o r t = " " "
'' ;
2022-10-19 03:24:28 +00:00
nativeBuildInputs = with python3 . pkgs ; [
setuptools-scm
] ;
2022-10-14 22:08:30 +00:00
2023-01-21 12:00:00 +00:00
nativeCheckInputs = with python3 . pkgs ; [
2022-10-02 16:05:42 +00:00
aspell-python
chardet
pytestCheckHook
pytest-dependency
] ;
2021-02-12 19:14:54 +00:00
2022-10-19 03:24:28 +00:00
SETUPTOOLS_SCM_PRETEND_VERSION = version ;
2021-02-12 19:14:54 +00:00
preCheck = ''
export ASPELL_CONF = " d i c t - d i r ${ aspellDicts . en } / l i b / a s p e l l "
2019-08-07 21:04:48 +00:00
'' ;
2022-08-19 11:48:55 +00:00
disabledTests = [
# tries to run not fully installed script
" t e s t _ c o m m a n d "
# 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
" t e s t _ d i c t i o n a r y _ f o r m a t t i n g "
] ;
2021-02-12 19:14:54 +00:00
2020-11-29 17:27:55 +00:00
pythonImportsCheck = [ " c o d e s p e l l _ l i b " ] ;
2021-02-12 19:14:54 +00:00
meta = with lib ; {
2019-08-07 21:04:48 +00:00
description = " F i x c o m m o n m i s s p e l l i n g s i n s o u r c e c o d e " ;
homepage = " h t t p s : / / g i t h u b . c o m / c o d e s p e l l - p r o j e c t / c o d e s p e l l " ;
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
} ;
}