depot/third_party/nixpkgs/pkgs/development/python-modules/ziamath/default.nix
Default email 60f07311b9 Project import generated by Copybara.
GitOrigin-RevId: f8e2ebd66d097614d51a56a755450d4ae1632df1
2024-02-06 17:22:34 -08:00

58 lines
1.2 KiB
Nix

{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, setuptools
, ziafont
, pytestCheckHook
, nbval
, latex2mathml
}:
buildPythonPackage rec {
pname = "ziamath";
version = "0.9";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "cdelker";
repo = pname;
rev = version;
hash = "sha256-ISd+J7R8qZ0NXdlyHMj+torzr+541UAhNCSaUH8ytSQ=";
};
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
ziafont
];
nativeCheckInputs = [
pytestCheckHook
nbval
latex2mathml
];
pytestFlagsArray = [ "--nbval-lax" ];
# Prevent the test suite from attempting to download fonts
postPatch = ''
substituteInPlace test/styles.ipynb \
--replace '"def testfont(exprs, fonturl):\n",' '"def testfont(exprs, fonturl):\n", " return\n",' \
--replace "mathfont='FiraMath-Regular.otf', " ""
'';
pythonImportsCheck = [ "ziamath" ];
meta = with lib; {
description = "Render MathML and LaTeX Math to SVG without Latex installation";
homepage = "https://ziamath.readthedocs.io/en/latest/";
changelog = "https://ziamath.readthedocs.io/en/latest/changes.html";
license = licenses.mit;
maintainers = with maintainers; [ sfrijters ];
};
}