Something went wrong. Try again.
lol
Something went wrong. Try again.
2.7 kB · 133 lines
Nix
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134{ lib, stdenv, buildPythonPackage, fetchFromGitHub, nodejs, yarn-berry_3,
# build-system hatch-jupyter-builder, hatchling, jupyterlab,
# dependencies markdown-it-py, mdit-py-plugins, nbformat, packaging, pyyaml,
# tests addBinToPathHook, jupyter-client, notebook, pytest-asyncio, pytest-xdist, pytestCheckHook, versionCheckHook, writableTmpDirAsHomeHook,}:
buildPythonPackage rec { pname = "jupytext"; version = "1.18.1"; pyproject = true;
src = fetchFromGitHub { owner = "mwouts"; repo = "jupytext"; tag = "v${version}"; hash = "sha256-D7Ps/lHF3F/7Jm4ozcjO8YsTPA1GQPqZVpPod/riGvA="; };
patches = [ ./fix-yarn-lock-typescript.patch ];
nativeBuildInputs = [ nodejs yarn-berry_3.yarnBerryConfigHook ];
missingHashes = ./missing-hashes.json;
offlineCache = yarn-berry_3.fetchYarnBerryDeps { inherit src missingHashes; patches = [ ./fix-yarn-lock-typescript-offline-cache.patch ]; sourceRoot = "${src.name}/jupyterlab"; hash = "sha256-k2lQnlSmCghIkp6VwNmq5KpSHS5tEbnFnsM+xqo3Ebw="; };
env.HATCH_BUILD_HOOKS_ENABLE = true;
preConfigure = '' pushd jupyterlab '';
preBuild = '' popd '';
build-system = [ hatch-jupyter-builder hatchling jupyterlab ];
dependencies = [ markdown-it-py mdit-py-plugins nbformat packaging pyyaml ];
nativeCheckInputs = [ addBinToPathHook jupyter-client notebook pytest-asyncio pytest-xdist pytestCheckHook versionCheckHook # Tests that use a Jupyter notebook require $HOME to be writable writableTmpDirAsHomeHook ];
preCheck = '' substituteInPlace tests/functional/contents_manager/test_async_and_sync_contents_manager_are_in_sync.py \ --replace-fail "from black import FileMode, format_str" "" \ --replace-fail "format_str(sync_code, mode=FileMode())" "sync_code" '';
disabledTestPaths = [ # Requires the `git` python module "tests/external" ];
disabledTests = [ # Fails due to whitespace differences in the outputs "test_async_and_sync_files_are_in_sync" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ # requires access to trash "test_load_save_rename" ];
pythonImportsCheck = [ "jupytext" "jupytext.cli" ];
meta = { description = "Jupyter notebooks as Markdown documents, Julia, Python or R scripts"; homepage = "https://github.com/mwouts/jupytext"; changelog = "https://github.com/mwouts/jupytext/blob/${src.tag}/CHANGELOG.md"; license = lib.licenses.mit; teams = [ lib.teams.jupyter ]; mainProgram = "jupytext"; };}