3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/inquirer/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

36 lines
1.1 KiB
Nix

{ lib, stdenv, buildPythonPackage, fetchFromGitHub, python-editor, readchar, blessed, pytest, pytestcov, pexpect, pytest-mock }:
buildPythonPackage rec {
pname = "inquirer";
version = "2.7.0";
# PyPi archive currently broken: https://github.com/magmax/python-inquirer/issues/106
src = fetchFromGitHub rec {
owner = "magmax";
repo = "python-inquirer";
rev = version;
sha256 = "152l5qjgkag8zkr69ax2i5s8xcac1qvyngisrplbnbzwbpf77d0d";
};
propagatedBuildInputs = [ blessed python-editor readchar ];
postPatch = ''
substituteInPlace requirements.txt \
--replace "blessed==1.17.6" "blessed~=1.17" \
--replace "readchar==2.0.1" "readchar>=2.0.0"
'';
checkInputs = [ pytest pytestcov pexpect pytest-mock ];
checkPhase = ''
pytest --cov-report=term-missing --cov inquirer --no-cov-on-fail tests/unit tests/integration
'';
meta = with lib; {
homepage = "https://github.com/magmax/python-inquirer";
description = "A collection of common interactive command line user interfaces, based on Inquirer.js";
license = licenses.mit;
maintainers = [ maintainers.mmahut ];
};
}