python3Packages.mpl-typst: add typst to closure, unbreak (#439897)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
buildPythonPackage,
|
||||
setuptools,
|
||||
@@ -8,6 +9,7 @@
|
||||
pytestCheckHook,
|
||||
pillow,
|
||||
nix-update-script,
|
||||
typst,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
@@ -22,6 +24,14 @@ 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
|
||||
];
|
||||
@@ -36,11 +46,25 @@ buildPythonPackage rec {
|
||||
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 { };
|
||||
|
||||
meta = {
|
||||
|
||||
@@ -9665,7 +9665,9 @@ self: super: with self; {
|
||||
|
||||
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 { };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user