1{ lib, buildPythonApplication, fetchPypi, pytest, chardet }:
2buildPythonApplication rec {
3 pname = "codespell";
4 version = "1.17.1";
5
6 src = fetchPypi {
7 inherit pname version;
8 sha256 = "08ydpw8pim7rhg1x2n711hxf2y6553nx0c0aqhfi3p4wdgcfr8i5";
9 };
10
11 checkInputs = [ pytest chardet ];
12 checkPhase = ''
13 # We don't want to be affected by the presence of these
14 rm -r codespell_lib setup.cfg
15 # test_command assumes too much about the execution environment
16 pytest --pyargs codespell_lib.tests -k "not test_command"
17 '';
18
19 meta = {
20 description = "Fix common misspellings in source code";
21 homepage = "https://github.com/codespell-project/codespell";
22 license = with lib.licenses; [ gpl2 cc-by-sa-30 ];
23 maintainers = with lib.maintainers; [ johnazoidberg ];
24 platforms = lib.platforms.all;
25 };
26}