python3Packages.mpl-typst: add typst to closure, unbreak

Changed files
+27 -1
pkgs
development
python-modules
mpl-typst
top-level
+24
pkgs/development/python-modules/mpl-typst/default.nix
···
{
lib,
+
stdenv,
fetchFromGitHub,
buildPythonPackage,
setuptools,
···
pytestCheckHook,
pillow,
nix-update-script,
+
typst,
}:
buildPythonPackage rec {
···
hash = "sha256-lkO4BTo3duNAsppTjteeBuzgSJL/UnKVW2QXgrfVrqM=";
};
+
postPatch = ''
+
# make hermetic
+
substituteInPlace mpl_typst/config.py \
+
--replace-fail \
+
"get_typst_compiler(name: str, default=Path('typst'))" \
+
"get_typst_compiler(name: str, default=Path('${lib.getExe typst}'))"
+
'';
+
build-system = [
setuptools
];
···
pillow
numpy
];
+
+
pytestFlagsArray = [ "-v" ];
pythonImportsCheck = [
"mpl_typst"
"mpl_typst.as_default"
+
];
+
+
disabledTests = [
+
# runs typst and gets "error: failed to download package"
+
"test_draw_path"
+
"test_draw_image_lenna"
+
"test_draw_image_spy"
+
];
+
+
disabledTestPaths = lib.optional stdenv.hostPlatform.isDarwin [
+
# fatal error when matplotlib creates a canvas
+
"mpl_typst/backend_test.py"
];
passthru.updateScript = nix-update-script { };
+3 -1
pkgs/top-level/python-packages.nix
···
mpl-scatter-density = callPackage ../development/python-modules/mpl-scatter-density { };
-
mpl-typst = callPackage ../development/python-modules/mpl-typst { };
+
mpl-typst = callPackage ../development/python-modules/mpl-typst {
+
inherit (pkgs) typst;
+
};
mplcursors = callPackage ../development/python-modules/mplcursors { };