[py-torch-fidelity] New package (#46257)

* [py-torch-fidelity] New package
* [py-torch-fidelity] add patch to fix missing requirements.txt
This commit is contained in:
Jen Herting 2024-09-06 20:54:36 -04:00 committed by GitHub
parent 6f08db4631
commit 7d6b643b58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,33 @@
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack.package import *
class PyTorchFidelity(PythonPackage):
"""High-fidelity performance metrics for generative models in PyTorch"""
homepage = "https://www.github.com/toshas/torch-fidelity"
pypi = "torch_fidelity/torch_fidelity-0.3.0.tar.gz"
license("Apache-2.0", checked_by="qwertos")
version("0.3.0", sha256="3d3e33db98919759cc4f3f24cb27e1e74bdc7c905d90a780630e4e1c18492b66")
depends_on("py-setuptools", type="build")
depends_on("py-numpy", type=("build", "run"))
depends_on("pil", type=("build", "run"))
depends_on("py-scipy", type=("build", "run"))
depends_on("py-torch", type=("build", "run"))
depends_on("py-torchvision", type=("build", "run"))
depends_on("py-tqdm", type=("build", "run"))
def patch(self):
os.rename(
join_path(self.stage.source_path, "torch_fidelity.egg-info", "requires.txt"),
join_path(self.stage.source_path, "requirements.txt"),
)