depot/third_party/nixpkgs/pkgs/development/python-modules/ziamath/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

55 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
setuptools,
ziafont,
pytestCheckHook,
nbval,
latex2mathml,
}:
buildPythonPackage rec {
pname = "ziamath";
version = "0.10";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "cdelker";
repo = pname;
rev = version;
hash = "sha256-Drssi+YySh4OhVYAOvgIwzeeu5dQbUUXuhwTedhUUt8=";
};
build-system = [ setuptools ];
dependencies = [ 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 ];
};
}