2021-01-25 09:26:54 +01:00
|
|
|
{
|
|
|
|
lib,
|
2020-06-03 22:09:54 +02:00
|
|
|
buildPythonPackage,
|
2025-01-21 16:24:43 -08:00
|
|
|
fetchFromGitHub,
|
2020-06-03 22:09:54 +02:00
|
|
|
curtsies,
|
2021-12-20 20:40:40 +00:00
|
|
|
cwcwidth,
|
2020-06-03 22:09:54 +02:00
|
|
|
greenlet,
|
2021-04-27 19:55:00 +02:00
|
|
|
jedi,
|
2020-06-03 22:09:54 +02:00
|
|
|
pygments,
|
2021-12-20 20:40:40 +00:00
|
|
|
pytestCheckHook,
|
|
|
|
pyperclip,
|
2021-04-27 19:55:00 +02:00
|
|
|
pyxdg,
|
2020-06-03 22:09:54 +02:00
|
|
|
requests,
|
2025-01-21 16:24:43 -08:00
|
|
|
setuptools,
|
2020-06-03 22:09:54 +02:00
|
|
|
urwid,
|
2021-04-27 19:55:00 +02:00
|
|
|
watchdog,
|
|
|
|
}:
|
2017-10-29 11:21:40 +01:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bpython";
|
2025-01-21 16:24:43 -08:00
|
|
|
version = "0.25";
|
|
|
|
pyproject = true;
|
2022-05-03 10:18:45 +02:00
|
|
|
|
2025-01-21 16:24:43 -08:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bpython";
|
|
|
|
repo = "bpython";
|
|
|
|
tag = version;
|
|
|
|
hash = "sha256-p5+IQiHNRRazqr+WRdx3Yw+ImG25tdZGLXvMf7woD9w=";
|
2017-10-29 11:21:40 +01:00
|
|
|
};
|
|
|
|
|
2025-01-21 16:24:43 -08:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace-fail 'version = "unknown"' 'version = "${version}"'
|
|
|
|
'';
|
|
|
|
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [
|
2021-04-27 19:55:00 +02:00
|
|
|
curtsies
|
2021-12-20 20:40:40 +00:00
|
|
|
cwcwidth
|
2021-04-27 19:55:00 +02:00
|
|
|
greenlet
|
|
|
|
pygments
|
|
|
|
pyxdg
|
|
|
|
requests
|
|
|
|
];
|
2017-10-29 11:21:40 +01:00
|
|
|
|
2025-01-21 16:24:43 -08:00
|
|
|
optional-dependencies = {
|
|
|
|
clipboard = [ pyperclip ];
|
|
|
|
jedi = [ jedi ];
|
|
|
|
urwid = [ urwid ];
|
|
|
|
watch = [ watchdog ];
|
|
|
|
};
|
|
|
|
|
2019-03-05 10:30:37 +01:00
|
|
|
postInstall = ''
|
2019-10-31 16:38:19 +01:00
|
|
|
substituteInPlace "$out/share/applications/org.bpython-interpreter.bpython.desktop" \
|
2025-01-21 16:24:43 -08:00
|
|
|
--replace "Exec=/usr/bin/bpython" "Exec=bpython"
|
2019-03-05 10:30:37 +01:00
|
|
|
'';
|
|
|
|
|
2025-01-21 16:24:43 -08:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
] ++ lib.flatten (lib.attrValues optional-dependencies);
|
2021-12-20 20:40:40 +00:00
|
|
|
|
2022-05-03 10:18:45 +02:00
|
|
|
pythonImportsCheck = [ "bpython" ];
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2025-01-21 16:24:43 -08:00
|
|
|
changelog = "https://github.com/bpython/bpython/blob/${src.tag}/CHANGELOG.rst";
|
2017-10-29 11:21:40 +01:00
|
|
|
description = "Fancy curses interface to the Python interactive interpreter";
|
|
|
|
homepage = "https://bpython-interpreter.org/";
|
|
|
|
license = licenses.mit;
|
2021-12-20 20:40:40 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
flokli
|
|
|
|
dotlambda
|
|
|
|
];
|
2017-10-29 11:21:40 +01:00
|
|
|
};
|
|
|
|
}
|