From d7e740defa100d138d9ca71f64af3e3bdc4786ed Mon Sep 17 00:00:00 2001 From: Jonas Eschle Date: Fri, 9 May 2025 07:29:02 +0200 Subject: [PATCH] py-hepstats: new package (#43697) * enh: add py-hepstats package * fix: version * fix: update pypi version * fix: update hash * fix: use github package * fix: allow download from pypi * chore: remove unused Bazel, cleanup imports * enh: add 0.9.2 version * fix: update dependencies for version 0.9.0 and adjust build system * chore: move to new builtin directory --------- Co-authored-by: jonas-eschle --- .../builtin/packages/py_hepstats/package.py | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 var/spack/repos/spack_repo/builtin/packages/py_hepstats/package.py diff --git a/var/spack/repos/spack_repo/builtin/packages/py_hepstats/package.py b/var/spack/repos/spack_repo/builtin/packages/py_hepstats/package.py new file mode 100644 index 00000000000..6bbe00381c2 --- /dev/null +++ b/var/spack/repos/spack_repo/builtin/packages/py_hepstats/package.py @@ -0,0 +1,43 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyHepstats(PythonPackage): + """hepstats is a library for statistical inference aiming + to cover the needs in High Energy Physics. + It is part of the Scikit-HEP project. + """ + + homepage = "https://github.com/scikit-hep/hepstats" + pypi = "hepstats/hepstats-0.8.1.tar.gz" + maintainers("jonas-eschle") + + license("BSD-3-Clause", checked_by="jonas-eschle") + + tags = ["likelihood", "statistics", "inference", "fitting", "hep"] + + version("0.9.2", sha256="cf929871d45e338492eef585faaaa23eff93b200b4787d6b6181dc81f2607be7") + version("0.8.1", sha256="ebb890496d7aebbf1d717de15d073be31d6775065308a4e0f263ed4051992b3f") + + depends_on("python@3.9:", type=("build", "run"), when="@0.8:") + # Build system changed from setuptools to hatch with v0.9.0 + depends_on("py-setuptools@42:", type="build", when="@:0.8.1") + depends_on("py-setuptools-scm@3.4:+toml", type="build", when="@:0.8.1") + depends_on("py-hatchling", type="build", when="@0.9.0:") + depends_on("py-hatch-vcs", type="build", when="@0.9.0:") + + variant("zfit", default=False, description="Allows to use improved tools from zfit.") + + with default_args(type=("build", "run")): + depends_on("py-pandas") + depends_on("py-numpy") + depends_on("py-asdf") + depends_on("py-scipy") + depends_on("py-tqdm") + depends_on("py-uhi") + + with when("+zfit"): + depends_on("py-zfit@0.20:", when="@0.8:")