1{
2 lib,
3 stdenv,
4 attrs,
5 buildPythonPackage,
6 colorama,
7 fetchPypi,
8 glibcLocales,
9 gnureadline,
10 pyperclip,
11 pytest-cov-stub,
12 pytest-mock,
13 pytestCheckHook,
14 pythonOlder,
15 setuptools-scm,
16 wcwidth,
17}:
18
19buildPythonPackage rec {
20 pname = "cmd2";
21 version = "2.6.1";
22 pyproject = true;
23
24 disabled = pythonOlder "3.9";
25
26 src = fetchPypi {
27 inherit pname version;
28 hash = "sha256-ZQpYkr8psjPT1ndbXjzIE2SM/w15E09weYH2a6rtn0I=";
29 };
30
31 build-system = [ setuptools-scm ];
32
33 dependencies = [
34 attrs
35 colorama
36 pyperclip
37 wcwidth
38 ]
39 ++ lib.optional stdenv.hostPlatform.isDarwin gnureadline;
40
41 doCheck = true;
42
43 nativeCheckInputs = [
44 glibcLocales
45 pytestCheckHook
46 pytest-cov-stub
47 pytest-mock
48 ];
49
50 disabledTests = [
51 # Don't require vim for tests, it causes lots of rebuilds
52 "test_find_editor_not_specified"
53 "test_transcript"
54 ];
55
56 pythonImportsCheck = [ "cmd2" ];
57
58 meta = with lib; {
59 description = "Enhancements for standard library's cmd module";
60 homepage = "https://github.com/python-cmd2/cmd2";
61 changelog = "https://github.com/python-cmd2/cmd2/releases/tag/${version}";
62 license = with licenses; [ mit ];
63 maintainers = with maintainers; [ teto ];
64 };
65}