depot/third_party/nixpkgs/pkgs/development/python-modules/schemdraw/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

70 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
setuptools,
pyparsing,
matplotlib,
latex2mathml,
ziafont,
ziamath,
pytestCheckHook,
nbval,
}:
buildPythonPackage rec {
pname = "schemdraw";
version = "0.19";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "cdelker";
repo = pname;
rev = version;
hash = "sha256-vqEHcazE5DNHr0FceOWLqq+RZmMK5ovHDVjy/2wbTJU=";
};
build-system = [ setuptools ];
dependencies = [ pyparsing ];
optional-dependencies = {
matplotlib = [ matplotlib ];
svgmath = [
latex2mathml
ziafont
ziamath
];
};
nativeCheckInputs = [
pytestCheckHook
nbval
matplotlib
latex2mathml
ziafont
ziamath
];
# Strip out references to unfree fonts from the test suite
postPatch = ''
substituteInPlace test/test_styles.ipynb --replace "font='Times', " ""
'';
preCheck = "rm test/test_pictorial.ipynb"; # Tries to download files
pytestFlagsArray = [ "--nbval-lax" ];
pythonImportsCheck = [ "schemdraw" ];
meta = with lib; {
description = "Package for producing high-quality electrical circuit schematic diagrams";
homepage = "https://schemdraw.readthedocs.io/en/latest/";
changelog = "https://schemdraw.readthedocs.io/en/latest/changes.html";
license = licenses.mit;
maintainers = with maintainers; [ sfrijters ];
};
}