diff options
author | M. Eric Irrgang <mei2n@virginia.edu> | 2023-03-02 17:37:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-02 08:37:17 -0600 |
commit | dd7af323edd0a66e0af10bad4051a5759671d525 (patch) | |
tree | f5544d46937f5b4d66804ab90e7559fdd7b5d0c8 /var | |
parent | 2ba1f700e6bb0151532cc585ca0a64b4cb3dc69c (diff) | |
download | spack-dd7af323edd0a66e0af10bad4051a5759671d525.tar.gz spack-dd7af323edd0a66e0af10bad4051a5759671d525.tar.bz2 spack-dd7af323edd0a66e0af10bad4051a5759671d525.tar.xz spack-dd7af323edd0a66e0af10bad4051a5759671d525.zip |
Add a `py-gmxapi` package. (#35738)
* Add a `py-gmxapi` package.
This package provides the Python package for the GROMACS
public API. The Python package is not strongly coupled to
a specific GROMACS _version_, but its compiled extension module
is strongly coupled to a specific GROMACS _installation_.
* Update conflict info.
In order to allow `^gromacs@2022.1` while rejecting `^gromacs@2022`,
we need to compare to `gromacs@2022.0`.
* Apply suggestions from code review
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
* Apply suggestions from code review.
* Simplify build system structure.
* Update dependencies for completeness.
* Update var/spack/repos/builtin/packages/py-gmxapi/package.py
Per code review, pretend gmxapi <0.4 doesn't exist, for simplicity.
* Update var/spack/repos/builtin/packages/py-gmxapi/package.py
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
* Update var/spack/repos/builtin/packages/py-gmxapi/package.py
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
---------
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/py-gmxapi/package.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-gmxapi/package.py b/var/spack/repos/builtin/packages/py-gmxapi/package.py new file mode 100644 index 0000000000..673693b518 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-gmxapi/package.py @@ -0,0 +1,48 @@ +# Copyright 2013-2023 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 PyGmxapi(PythonPackage): + """Python bindings and ensemble workflow management for GROMACS. + + The GROMACS C++ API is affected by its package variants. You can + specify a particular GROMACS API by making the dependency variant explicit. + E.g. ``spack install gmxapi ^gromacs+mpi~double`` + """ + + homepage = "https://manual.gromacs.org/current/gmxapi/index.html" + maintainers("eirrgang", "peterkasson") + + pypi = "gmxapi/gmxapi-0.4.0.tar.gz" + version("0.4.0", sha256="7fd58e6a4b1391043379e8ba55555ebeba255c5b394f5df9d676e6a5571d7eba") + + depends_on("gromacs@2022.1:~mdrun_only+shared") + depends_on("mpi") + depends_on("py-cmake@3.16:", type="build") + depends_on("py-importlib-metadata", type="test", when="^python@:3.7") + depends_on("py-mpi4py", type=("build", "run")) + depends_on("py-networkx@2.0:", type=("build", "run")) + depends_on("py-numpy@1.8:", type=("build", "run")) + depends_on("py-setuptools@42:", type="build") + depends_on("py-packaging", type=("build", "run")) + depends_on("py-pybind11@2.6:", type=("build", "run")) + depends_on("py-pytest@4.6:", type="test") + depends_on("py-wheel", type="build") + + def setup_build_environment(self, env): + env.set("GROMACS_DIR", self.spec["gromacs"].prefix) + env.set("gmxapi_ROOT", self.spec["gromacs"].prefix) + env.set("Python3_ROOT", self.spec["python"].home) + + @run_after("install") + @on_package_attributes(run_tests=True) + def install_test(self): + with working_dir("spack-test", create=True): + # test include helper points to right location + python = self.spec["python"].command + python("-m", "pytest", "-x", os.path.join(self.build_directory, "test")) |