2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
pythonOlder,
|
|
|
|
hatchling,
|
|
|
|
ipykernel,
|
|
|
|
exceptiongroup,
|
|
|
|
ipython,
|
|
|
|
jupyter-client,
|
|
|
|
jupyter-core,
|
|
|
|
prompt-toolkit,
|
|
|
|
pygments,
|
|
|
|
pyzmq,
|
|
|
|
traitlets,
|
|
|
|
flaky,
|
|
|
|
pexpect,
|
|
|
|
pytestCheckHook,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2023-10-09 19:29:22 +00:00
|
|
|
pname = "jupyter-console";
|
|
|
|
version = "6.6.3";
|
2023-03-15 16:39:30 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2023-10-09 19:29:22 +00:00
|
|
|
pname = "jupyter_console";
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256-VmpL8xyHrb+t8izfhG4wabWace1dpx1rpNiqrRSlNTk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ hatchling ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# use wrapped executable in tests
|
|
|
|
substituteInPlace jupyter_console/tests/test_console.py \
|
|
|
|
--replace "args = ['-m', 'jupyter_console', '--colors=NoColor']" "args = ['--colors=NoColor']" \
|
|
|
|
--replace "cmd = sys.executable" "cmd = '${placeholder "out"}/bin/jupyter-console'" \
|
|
|
|
--replace "check_output([sys.executable, '-m', 'jupyter_console'," "check_output(['${placeholder "out"}/bin/jupyter-console',"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
ipykernel
|
2023-03-15 16:39:30 +00:00
|
|
|
ipython
|
|
|
|
jupyter-client
|
|
|
|
jupyter-core
|
2021-08-05 21:33:18 +00:00
|
|
|
prompt-toolkit
|
2020-04-24 23:36:52 +00:00
|
|
|
pygments
|
2023-03-15 16:39:30 +00:00
|
|
|
pyzmq
|
|
|
|
traitlets
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.11") [ exceptiongroup ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "jupyter_console" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
flaky
|
|
|
|
pexpect
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Jupyter terminal console";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "jupyter-console";
|
2023-03-15 16:39:30 +00:00
|
|
|
homepage = "https://github.com/jupyter/jupyter_console";
|
|
|
|
changelog = "https://github.com/jupyter/jupyter_console/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = lib.licenses.bsd3;
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = lib.teams.jupyter.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|