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