From 4da5ab286d0ba56be58f270603ceaef153559edf Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 19 Mar 2023 13:35:04 +0100 Subject: [PATCH] python3Packages.schemdraw: init at 0.16 --- .../python-modules/schemdraw/default.nix | 68 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 70 insertions(+) create mode 100644 pkgs/development/python-modules/schemdraw/default.nix diff --git a/pkgs/development/python-modules/schemdraw/default.nix b/pkgs/development/python-modules/schemdraw/default.nix new file mode 100644 index 000000000000..c3da6e6edc79 --- /dev/null +++ b/pkgs/development/python-modules/schemdraw/default.nix @@ -0,0 +1,68 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromBitbucket +, pyparsing +, matplotlib +, latex2mathml +, ziafont +, ziamath +, pytestCheckHook +, nbval +}: + +buildPythonPackage rec { + pname = "schemdraw"; + version = "0.16"; + format = "pyproject"; + + disabled = pythonOlder "3.8"; + + src = fetchFromBitbucket { + owner = "cdelker"; + repo = pname; + rev = version; + hash = "sha256-W9sXtYI8gEwQPRo50taEGT6AQG1tdAbeCtX49eHVvFQ="; + }; + + propagatedBuildInputs = [ + pyparsing + ]; + + passthru.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', " "" + ''; + + pytestFlagsArray = [ "--nbval-lax" ]; + + pythonImportsCheck = [ "schemdraw" ]; + + meta = with lib; { + description = "A 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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9876e6c38ffb..5569f3027bd3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10533,6 +10533,8 @@ self: super: with self; { schema-salad = callPackage ../development/python-modules/schema-salad { }; + schemdraw = callPackage ../development/python-modules/schemdraw { }; + schiene = callPackage ../development/python-modules/schiene { }; schwifty = callPackage ../development/python-modules/schwifty { };