From 787bae5d715374e50a52950ffb5b3b4e2b03bcb1 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 27 Jun 2023 18:32:45 -0400 Subject: [PATCH 1/2] python310Packages.mplhep-data: init at 0.0.3 --- .../python-modules/mplhep-data/default.nix | 34 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/development/python-modules/mplhep-data/default.nix diff --git a/pkgs/development/python-modules/mplhep-data/default.nix b/pkgs/development/python-modules/mplhep-data/default.nix new file mode 100644 index 0000000000000..12ec813f12b97 --- /dev/null +++ b/pkgs/development/python-modules/mplhep-data/default.nix @@ -0,0 +1,34 @@ +{ lib +, buildPythonPackage +, fetchPypi +, setuptools +, setuptools-scm +}: + +buildPythonPackage rec { + pname = "mplhep-data"; + version = "0.0.3"; + format = "pyproject"; + + src = fetchPypi { + pname = "mplhep_data"; + inherit version; + hash = "sha256-tU0lfz9TyTpELNp6ZoHOJnJ34JFzwLQf14gg94Mhdy8="; + }; + + nativeBuildInputs = [ + setuptools + setuptools-scm + ]; + + pythonImportsCheck = [ + "mplhep_data" + ]; + + meta = with lib; { + description = "Sub-package to hold data (fonts) for mplhep"; + homepage = "https://github.com/scikit-hep/mplhep_data"; + license = with licenses; [ mit gfl ofl ]; + maintainers = with maintainers; [ veprbl ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 64c10db8a8971..fe7d2833bd3b1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6494,6 +6494,8 @@ self: super: with self; { mplfinance = callPackage ../development/python-modules/mplfinance { }; + mplhep_data = callPackage ../development/python-modules/mplhep_data { }; + mplleaflet = callPackage ../development/python-modules/mplleaflet { }; mpmath = callPackage ../development/python-modules/mpmath { }; From 560a07f5070b390103fbb3eb8ae12ed1b2955bf8 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 27 Jun 2023 18:33:16 -0400 Subject: [PATCH 2/2] python310Packages.mplhep: init at 0.3.28 --- .../python-modules/mplhep/default.nix | 63 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 +- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/python-modules/mplhep/default.nix diff --git a/pkgs/development/python-modules/mplhep/default.nix b/pkgs/development/python-modules/mplhep/default.nix new file mode 100644 index 0000000000000..63a81c47e303d --- /dev/null +++ b/pkgs/development/python-modules/mplhep/default.nix @@ -0,0 +1,63 @@ +{ lib +, buildPythonPackage +, fetchPypi +, hist +, matplotlib +, mplhep-data +, pytestCheckHook +, pytest-mock +, pytest-mpl +, scipy +, setuptools +, setuptools-scm +, uhi +, uproot +}: + +buildPythonPackage rec { + pname = "mplhep"; + version = "0.3.28"; + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-/7nfjIdlYoouDOI1vXdr9BSml5gpE0gad7ONAUmOCiE="; + }; + + nativeBuildInputs = [ + setuptools + setuptools-scm + ]; + + propagatedBuildInputs = [ + matplotlib + uhi + mplhep-data + ]; + + nativeCheckInputs = [ + hist + pytestCheckHook + pytest-mock + pytest-mpl + scipy + uproot + ]; + + disabledTests = [ + # requires uproot4 + "test_inputs_uproot" + "test_uproot_versions" + ]; + + pythonImportsCheck = [ + "mplhep" + ]; + + meta = with lib; { + description = "Extended histogram plots on top of matplotlib and HEP compatible styling similar to current collaboration requirements (ROOT)"; + homepage = "https://github.com/scikit-hep/mplhep"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ veprbl ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fe7d2833bd3b1..1db525e130869 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6494,7 +6494,9 @@ self: super: with self; { mplfinance = callPackage ../development/python-modules/mplfinance { }; - mplhep_data = callPackage ../development/python-modules/mplhep_data { }; + mplhep = callPackage ../development/python-modules/mplhep { }; + + mplhep-data = callPackage ../development/python-modules/mplhep-data { }; mplleaflet = callPackage ../development/python-modules/mplleaflet { };