python3Packages.inquirer: fix build and src

This commit is contained in:
Martin Weinelt 2022-01-17 02:29:51 +01:00
parent d1a4527ed6
commit 0e2b063114

View file

@ -1,30 +1,48 @@
{ lib, buildPythonPackage, fetchFromGitHub, python-editor, readchar, blessed, pytest, pytest-cov, pexpect, pytest-mock }:
{ lib
, buildPythonPackage
, fetchFromGitHub
# native
, poetry-core
# propagated
, blessed
, python-editor
, readchar
# tests
, pytest-mock
, pytestCheckHook
, pexpect
}:
buildPythonPackage rec {
pname = "inquirer";
version = "2.9.1";
format = "pyproject";
# PyPi archive currently broken: https://github.com/magmax/python-inquirer/issues/106
src = fetchFromGitHub rec {
owner = "magmax";
repo = "python-inquirer";
rev = version;
sha256 = "0vdly2k4i7bfcqc8zh2miv9dbpmqvayxk72qn9d4hr7z15wph233";
rev = "v${version}";
sha256 = "sha256:0vdly2k4i7bfcqc8zh2miv9dbpmqvayxk72qn9d4hr7z15wph233";
};
propagatedBuildInputs = [ blessed python-editor readchar ];
nativeBuildInputs = [
poetry-core
];
postPatch = ''
substituteInPlace requirements.txt \
--replace "blessed==1.17.6" "blessed~=1.17" \
--replace "readchar==2.0.1" "readchar>=2.0.0"
'';
propagatedBuildInputs = [
blessed
python-editor
readchar
];
checkInputs = [ pytest pytest-cov pexpect pytest-mock ];
checkPhase = ''
pytest --cov-report=term-missing --cov inquirer --no-cov-on-fail tests/unit tests/integration
'';
checkInputs = [
pexpect
pytest-mock
pytestCheckHook
];
meta = with lib; {
homepage = "https://github.com/magmax/python-inquirer";