504525a148
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
81 lines
1.5 KiB
Nix
81 lines
1.5 KiB
Nix
{ lib
|
|
, stdenv
|
|
, buildPythonPackage
|
|
, fetchPypi
|
|
, hatch-jupyter-builder
|
|
, hatchling
|
|
, jupyter-client
|
|
, markdown-it-py
|
|
, mdit-py-plugins
|
|
, nbformat
|
|
, notebook
|
|
, packaging
|
|
, pytest-xdist
|
|
, pytestCheckHook
|
|
, pythonOlder
|
|
, pyyaml
|
|
, toml
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "jupytext";
|
|
version = "1.16.0";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-lMfmd3XpDheSw5q3/KTgRZv3w1ZWEj6Nwunhs+lTuvg=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
hatch-jupyter-builder
|
|
hatchling
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
markdown-it-py
|
|
mdit-py-plugins
|
|
nbformat
|
|
packaging
|
|
pyyaml
|
|
toml
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
jupyter-client
|
|
notebook
|
|
pytest-xdist
|
|
pytestCheckHook
|
|
];
|
|
|
|
preCheck = ''
|
|
# Tests that use a Jupyter notebook require $HOME to be writable
|
|
export HOME=$(mktemp -d);
|
|
export PATH=$out/bin:$PATH;
|
|
'';
|
|
|
|
disabledTestPaths = [
|
|
"tests/external"
|
|
];
|
|
|
|
disabledTests = lib.optionals stdenv.isDarwin [
|
|
# requires access to trash
|
|
"test_load_save_rename"
|
|
];
|
|
|
|
pythonImportsCheck = [
|
|
"jupytext"
|
|
"jupytext.cli"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Jupyter notebooks as Markdown documents, Julia, Python or R scripts";
|
|
homepage = "https://github.com/mwouts/jupytext";
|
|
changelog = "https://github.com/mwouts/jupytext/releases/tag/v${version}";
|
|
license = licenses.mit;
|
|
maintainers = teams.jupyter.members;
|
|
mainProgram = "jupytext";
|
|
};
|
|
}
|