Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 08:05:48

0001 # Copyright Spack Project Developers. See COPYRIGHT file for details.
0002 #
0003 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
0004 
0005 from spack_repo.builtin.build_systems.python import PythonPackage
0006 
0007 from spack.package import *
0008 
0009 
0010 class UprootMcpServer(PythonPackage):
0011     """An MCP server for inspecting and analyzing ROOT files with uproot."""
0012 
0013     homepage = "https://github.com/eic/uproot-mcp-server"
0014     url = "https://github.com/eic/uproot-mcp-server/archive/refs/tags/v0.1.0.tar.gz"
0015     git = "https://github.com/eic/uproot-mcp-server.git"
0016 
0017     maintainers("wdconinc")
0018 
0019     tags = ["eic"]
0020 
0021     license("MIT", checked_by="aprozo")
0022 
0023     version("main", branch="main")
0024     version("0.2.0", sha256="f1d27f87a4dc8c1ad0a3169d1b73e5cc7f4f2fddb574ae25e36f6b6c9bb218a8")
0025     version("0.1.0", sha256="b52485744f9e9112ada49c4455e51b6937a19922ca1c197be4b0d5656983b76f")
0026 
0027     depends_on("python@3.10:", type=("build", "run"))
0028     depends_on("py-hatchling", type="build")
0029 
0030     # mcp 2 dropped mcp.server.fastmcp
0031     depends_on("py-mcp@1", type=("build", "run"))
0032     depends_on("py-mcp@1.10:", type=("build", "run"), when="@0.2:")
0033     depends_on("py-uproot@5:", type=("build", "run"))
0034     # root:// URLs: upstream's optional `xrootd` extra (fsspec-xrootd, XRootD
0035     # python bindings), provided through py-uproot+xrootd
0036     variant("xrootd", default=True, description="Read root:// URLs")
0037     depends_on("py-uproot+xrootd", type=("build", "run"), when="+xrootd")
0038     depends_on("py-numpy@1.26.4:", type=("build", "run"))
0039     depends_on("py-awkward@2:", type=("build", "run"))
0040     depends_on("py-restrictedpython@8.1:", type=("build", "run"))
0041 
0042     def setup_build_environment(self, env):
0043         # `--test root` runs the import test in this environment, set up before
0044         # the install; python-venv adds site-packages only once it exists
0045         venv = self.spec["python-venv"].package
0046         for d in {venv.platlib, venv.purelib}:
0047             env.prepend_path("PYTHONPATH", join_path(self.prefix, d))