From a46fe14c908d46d9331adae8cbbba687c8f12f71 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 19 Mar 2023 13:31:24 +0100 Subject: [PATCH 1/4] python3Packages.latex2mathml, latex2mathml: init at 3.75.2 --- .../python-modules/latex2mathml/default.nix | 55 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + pkgs/top-level/python-packages.nix | 2 + 3 files changed, 59 insertions(+) create mode 100644 pkgs/development/python-modules/latex2mathml/default.nix diff --git a/pkgs/development/python-modules/latex2mathml/default.nix b/pkgs/development/python-modules/latex2mathml/default.nix new file mode 100644 index 000000000000..8737f0ef31da --- /dev/null +++ b/pkgs/development/python-modules/latex2mathml/default.nix @@ -0,0 +1,55 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, poetry-core +, setuptools +, pytestCheckHook +, multidict +, xmljson +}: + +buildPythonPackage rec { + pname = "latex2mathml"; + version = "3.75.2"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "roniemartinez"; + repo = pname; + rev = version; + hash = "sha256-i/F1B/Rndg66tiKok1PDMK/rT5c2e8upnQrMSCTUzpU="; + }; + + format = "pyproject"; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + setuptools # needs pkg_resources at runtime + ]; + + nativeCheckInputs = [ + pytestCheckHook + multidict + xmljson + ]; + + # Disable code coverage in check phase + postPatch = '' + sed -i '/--cov/d' pyproject.toml + ''; + + pythonImportsCheck = [ "latex2mathml" ]; + + meta = with lib; { + description = "Pure Python library for LaTeX to MathML conversion"; + homepage = "https://github.com/roniemartinez/latex2mathml"; + changelog = "https://github.com/roniemartinez/latex2mathml/releases/tag/${version}"; + license = licenses.mit; + maintainers = with maintainers; [ sfrijters ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4057e0ca1dd7..21e4468f02d4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4791,6 +4791,8 @@ with pkgs; gladtex = callPackage ../tools/typesetting/tex/gladtex { }; + latex2mathml = with python3Packages; toPythonApplication latex2mathml; + latexrun = callPackage ../tools/typesetting/tex/latexrun { }; lkproof = callPackage ../tools/typesetting/tex/lkproof { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ea6f4d83086f..a51bb2945025 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5341,6 +5341,8 @@ self: super: with self; { laszip = callPackage ../development/python-modules/laszip { }; + latex2mathml = callPackage ../development/python-modules/latex2mathml { }; + latexcodec = callPackage ../development/python-modules/latexcodec { }; latexify-py = callPackage ../development/python-modules/latexify-py { }; From 46c2b72e19ee08182b015bf98b89361eb8fc7b3f Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 19 Mar 2023 13:33:03 +0100 Subject: [PATCH 2/4] python3Packages.ziafont: init at 0.5 --- .../python-modules/ziafont/default.nix | 39 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/development/python-modules/ziafont/default.nix diff --git a/pkgs/development/python-modules/ziafont/default.nix b/pkgs/development/python-modules/ziafont/default.nix new file mode 100644 index 000000000000..5fc1298b7907 --- /dev/null +++ b/pkgs/development/python-modules/ziafont/default.nix @@ -0,0 +1,39 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromBitbucket +, pytestCheckHook +, nbval +}: + +buildPythonPackage rec { + pname = "ziafont"; + version = "0.5"; + + disabled = pythonOlder "3.8"; + + src = fetchFromBitbucket { + owner = "cdelker"; + repo = pname; + rev = version; + hash = "sha256-mTQ2yRG+E2nZ2g9eSg+XTzK8A1EgKsRfbvNO3CdYeLg="; + }; + + nativeCheckInputs = [ + pytestCheckHook + nbval + ]; + + preCheck = "rm test/manyfonts.ipynb"; # Tries to download fonts + + pytestFlagsArray = [ "--nbval-lax" ]; + + pythonImportsCheck = [ "ziafont" ]; + + meta = with lib; { + description = "Convert TTF/OTF font glyphs to SVG paths"; + homepage = "https://ziafont.readthedocs.io/en/latest/"; + license = licenses.mit; + maintainers = with maintainers; [ sfrijters ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a51bb2945025..0a8a300f6c4b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12938,6 +12938,8 @@ self: super: with self; { zha-quirks = callPackage ../development/python-modules/zha-quirks { }; + ziafont = callPackage ../development/python-modules/ziafont { }; + zict = callPackage ../development/python-modules/zict { }; zigpy = callPackage ../development/python-modules/zigpy { }; From 2b5351b24652ec719fddf03755286da85d15fce9 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 19 Mar 2023 13:33:35 +0100 Subject: [PATCH 3/4] python3Packages.ziamath: init at 0.7 --- .../python-modules/ziamath/default.nix | 45 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 47 insertions(+) create mode 100644 pkgs/development/python-modules/ziamath/default.nix diff --git a/pkgs/development/python-modules/ziamath/default.nix b/pkgs/development/python-modules/ziamath/default.nix new file mode 100644 index 000000000000..7a4d2520d87a --- /dev/null +++ b/pkgs/development/python-modules/ziamath/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromBitbucket +, ziafont +, pytestCheckHook +, nbval +, latex2mathml +}: + +buildPythonPackage rec { + pname = "ziamath"; + version = "0.7"; + + disabled = pythonOlder "3.8"; + + src = fetchFromBitbucket { + owner = "cdelker"; + repo = pname; + rev = version; + hash = "sha256-JuuCDww0EZEHZLxB5oQrWEJpv0szjwe4iXCRGl7OYTA="; + }; + + propagatedBuildInputs = [ + ziafont + ]; + + nativeCheckInputs = [ + pytestCheckHook + nbval + latex2mathml + ]; + + pytestFlagsArray = [ "--nbval-lax" ]; + + 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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0a8a300f6c4b..9876e6c38ffb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12940,6 +12940,8 @@ self: super: with self; { ziafont = callPackage ../development/python-modules/ziafont { }; + ziamath = callPackage ../development/python-modules/ziamath { }; + zict = callPackage ../development/python-modules/zict { }; zigpy = callPackage ../development/python-modules/zigpy { }; From 4da5ab286d0ba56be58f270603ceaef153559edf Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 19 Mar 2023 13:35:04 +0100 Subject: [PATCH 4/4] 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 { };