1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pytestCheckHook,
6 setuptools,
7 wcwidth,
8}:
9
10buildPythonPackage rec {
11 pname = "prompt-toolkit";
12 version = "3.0.51";
13 pyproject = true;
14
15 src = fetchPypi {
16 pname = "prompt_toolkit";
17 inherit version;
18 hash = "sha256-kxoWLjsn/JDIbxtIux+yxSjCdhR15XycBt4TMRx7VO0=";
19 };
20
21 postPatch = ''
22 # https://github.com/prompt-toolkit/python-prompt-toolkit/issues/1988
23 substituteInPlace src/prompt_toolkit/__init__.py \
24 --replace-fail 'metadata.version("prompt_toolkit")' '"${version}"'
25 '';
26
27 build-system = [ setuptools ];
28
29 dependencies = [ wcwidth ];
30
31 nativeCheckInputs = [ pytestCheckHook ];
32
33 disabledTests = [
34 # tests/test_completion.py:206: AssertionError
35 # https://github.com/prompt-toolkit/python-prompt-toolkit/issues/1657
36 "test_pathcompleter_can_expanduser"
37 ];
38
39 pythonImportsCheck = [ "prompt_toolkit" ];
40
41 meta = with lib; {
42 description = "Python library for building powerful interactive command lines";
43 longDescription = ''
44 prompt_toolkit could be a replacement for readline, but it can be
45 much more than that. It is cross-platform, everything that you build
46 with it should run fine on both Unix and Windows systems. Also ships
47 with a nice interactive Python shell (called ptpython) built on top.
48 '';
49 homepage = "https://github.com/jonathanslenders/python-prompt-toolkit";
50 changelog = "https://github.com/prompt-toolkit/python-prompt-toolkit/blob/${version}/CHANGELOG";
51 license = licenses.bsd3;
52 maintainers = [ ];
53 };
54}