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 = " c o d e s p e l l " ;
2023-11-16 04:20:00 +00:00
version = " 2 . 2 . 6 " ;
2022-10-30 15:09:59 +00:00
format = " p y p r o j e c t " ;
2020-04-24 23:36:52 +00:00
2021-02-13 14:23:35 +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 } " ;
2023-11-16 04:20:00 +00:00
sha256 = " s h a 2 5 6 - e s e w C J w 4 o 4 S f S s t 5 A L Z 9 0 X 3 X g O u O A s a x y t p o t v F e H B 0 = " ;
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 " - - 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-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
2022-10-30 15:09:59 +00:00
SETUPTOOLS_SCM_PRETEND_VERSION = version ;
2021-02-13 14:23:35 +00:00
preCheck = ''
export ASPELL_CONF = " d i c t - d i r ${ aspellDicts . en } / l i b / a s p e l l "
2020-04-24 23:36:52 +00:00
'' ;
2022-08-21 13:32:41 +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-13 14:23:35 +00:00
2020-12-07 07:45:13 +00:00
pythonImportsCheck = [ " c o d e s p e l l _ l i b " ] ;
2021-02-13 14:23:35 +00:00
meta = with lib ; {
2020-04-24 23:36:52 +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-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
} ;
}