depot/third_party/nixpkgs/pkgs/development/python-modules/pytest-jupyter/default.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

79 lines
1.5 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build
hatchling,
pytest,
# runtime
jupyter-core,
# optionals
jupyter-client,
ipykernel,
jupyter-server,
nbformat,
# tests
pytest-timeout,
pytestCheckHook,
}:
let
self = buildPythonPackage rec {
pname = "pytest-jupyter";
version = "0.10.1";
pyproject = true;
src = fetchFromGitHub {
owner = "jupyter-server";
repo = "pytest-jupyter";
rev = "refs/tags/v${version}";
hash = "sha256-RTpXBbVCRj0oyZ1TXXDv3M7sAI4kA6f3ouzTr0rXjwY=";
};
nativeBuildInputs = [ hatchling ];
buildInputs = [ pytest ];
propagatedBuildInputs = [ jupyter-core ];
optional-dependencies = {
client = [
jupyter-client
nbformat
ipykernel
];
server = [
jupyter-server
jupyter-client
nbformat
ipykernel
];
};
doCheck = false; # infinite recursion with jupyter-server
nativeCheckInputs = [
pytest-timeout
pytestCheckHook
] ++ lib.flatten (builtins.attrValues optional-dependencies);
passthru.tests = {
check = self.overridePythonAttrs (_: {
doCheck = false;
});
};
meta = with lib; {
changelog = "https://github.com/jupyter-server/pytest-jupyter/releases/tag/v${version}";
description = "pytest plugin for testing Jupyter core libraries and extensions";
homepage = "https://github.com/jupyter-server/pytest-jupyter";
license = licenses.bsd3;
maintainers = [ ];
};
};
in
self