summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2021-05-27 15:16:44 -0500
committerGitHub <noreply@github.com>2021-05-27 13:16:44 -0700
commitf92b7eca5e3c02d06287edb3770348a4ecab5073 (patch)
treec0fe6d61fe2aa566189cc50add81dcf742d46a31 /var
parentcc4029daabe6c633430ee67569e7a4ad0c4c5d02 (diff)
downloadspack-f92b7eca5e3c02d06287edb3770348a4ecab5073.tar.gz
spack-f92b7eca5e3c02d06287edb3770348a4ecab5073.tar.bz2
spack-f92b7eca5e3c02d06287edb3770348a4ecab5073.tar.xz
spack-f92b7eca5e3c02d06287edb3770348a4ecab5073.zip
py-eccodes: add new package (#23906)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/py-eccodes/package.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-eccodes/package.py b/var/spack/repos/builtin/packages/py-eccodes/package.py
new file mode 100644
index 0000000000..0fd0726bd5
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-eccodes/package.py
@@ -0,0 +1,49 @@
+# Copyright 2013-2021 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 sys
+
+from spack import *
+
+
+class PyEccodes(PythonPackage):
+ """Python interface to the ecCodes GRIB and BUFR decoder/encoder."""
+
+ homepage = "https://github.com/ecmwf/eccodes-python"
+ pypi = "eccodes/eccodes-1.3.2.tar.gz"
+
+ version('1.3.2', sha256='f282adfdc1bc658356163c9cef1857d4b2bae99399660d3d4fcb145a52d3b2a6')
+
+ depends_on('py-setuptools', type='build')
+ depends_on('py-numpy', type=('build', 'run'))
+ depends_on('py-attrs', type=('build', 'run'))
+ depends_on('py-cffi', type=('build', 'run'))
+ depends_on('py-findlibs', type=('build', 'run'))
+ depends_on('eccodes', type='run')
+
+ def setup_build_environment(self, env):
+ if sys.platform == 'darwin':
+ env.prepend_path('DYLD_LIBRARY_PATH',
+ self.spec['eccodes'].libs.directories[0])
+ else:
+ env.prepend_path('LD_LIBRARY_PATH',
+ self.spec['eccodes'].libs.directories[0])
+
+ def setup_run_environment(self, env):
+ self.setup_build_environment(env)
+
+ def setup_dependent_build_environment(self, env, dependent_spec):
+ self.setup_build_environment(env)
+
+ def setup_dependent_run_environment(self, env, dependent_spec):
+ self.setup_build_environment(env)
+
+ def test(self):
+ super(PyEccodes, self).test()
+
+ self.run_test(self.spec['python'].command.path,
+ ['-m', 'eccodes', 'selfcheck'],
+ purpose='checking system setup',
+ work_dir='spack-test')