1{ lib, buildPythonPackage, fetchFromGitHub, python-editor, readchar, blessed, pytest, pytest-cov, pexpect, pytest-mock }:
2
3buildPythonPackage rec {
4 pname = "inquirer";
5 version = "2.7.0";
6
7 # PyPi archive currently broken: https://github.com/magmax/python-inquirer/issues/106
8 src = fetchFromGitHub rec {
9 owner = "magmax";
10 repo = "python-inquirer";
11 rev = version;
12 sha256 = "152l5qjgkag8zkr69ax2i5s8xcac1qvyngisrplbnbzwbpf77d0d";
13 };
14
15 propagatedBuildInputs = [ blessed python-editor readchar ];
16
17 postPatch = ''
18 substituteInPlace requirements.txt \
19 --replace "blessed==1.17.6" "blessed~=1.17" \
20 --replace "readchar==2.0.1" "readchar>=2.0.0"
21 '';
22
23 checkInputs = [ pytest pytest-cov pexpect pytest-mock ];
24
25 checkPhase = ''
26 pytest --cov-report=term-missing --cov inquirer --no-cov-on-fail tests/unit tests/integration
27 '';
28
29 meta = with lib; {
30 homepage = "https://github.com/magmax/python-inquirer";
31 description = "A collection of common interactive command line user interfaces, based on Inquirer.js";
32 license = licenses.mit;
33 maintainers = [ maintainers.mmahut ];
34 };
35}