python311Packages.readchar: fix version, use pep517 builder

Checking runtime dependencies for inquirer-3.1.3-py3-none-any.whl
  - readchar>=3.0.6 not satisifeid by version 4.0.5.dev0
This commit is contained in:
Martin Weinelt
2023-12-20 20:10:25 +01:00
parent 0bf566dcc8
commit 7db4bc88ac
@@ -2,6 +2,9 @@
, buildPythonPackage
, fetchFromGitHub
# build-system
, setuptools
# tests
, pytestCheckHook
, pexpect
@@ -10,7 +13,7 @@
buildPythonPackage rec {
pname = "readchar";
version = "4.0.5";
format = "setuptools";
pyproject = true;
# Don't use wheels on PyPI
src = fetchFromGitHub {
@@ -22,13 +25,18 @@ buildPythonPackage rec {
postPatch = ''
substituteInPlace setup.cfg \
--replace "--cov=readchar" ""
--replace "--cov=readchar" "" \
--replace "attr: readchar.__version__" "${version}"
# run Linux tests on Darwin as well
# see https://github.com/magmax/python-readchar/pull/99 for why this is not upstreamed
substituteInPlace tests/linux/conftest.py \
--replace 'sys.platform.startswith("linux")' 'sys.platform.startswith(("darwin", "linux"))'
'';
nativeBuildInputs = [
setuptools
];
pythonImportsCheck = [ "readchar" ];
nativeCheckInputs = [