e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
80 lines
1.5 KiB
Nix
80 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,
|
|
tomli,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "jupytext";
|
|
version = "1.16.4";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-KOM/RvLOekH7nWd6SiyVMnKFV5tkyhBEN8S56x5BdOk=";
|
|
};
|
|
|
|
build-system = [
|
|
hatch-jupyter-builder
|
|
hatchling
|
|
];
|
|
|
|
dependencies = [
|
|
markdown-it-py
|
|
mdit-py-plugins
|
|
nbformat
|
|
packaging
|
|
pyyaml
|
|
] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
|
|
|
|
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.hostPlatform.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";
|
|
};
|
|
}
|