summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbernhardkaindl <43588962+bernhardkaindl@users.noreply.github.com>2021-09-28 17:37:09 +0200
committerGitHub <noreply@github.com>2021-09-28 10:37:09 -0500
commit3c5a4157b019d014a390db30c9a1c600ba6db4c1 (patch)
tree48bf039f4f885e33fb48d62fd58169b09f297f11
parentd00c9b47f2ad5f50e5ec0ac00577279d9a28b183 (diff)
downloadspack-3c5a4157b019d014a390db30c9a1c600ba6db4c1.tar.gz
spack-3c5a4157b019d014a390db30c9a1c600ba6db4c1.tar.bz2
spack-3c5a4157b019d014a390db30c9a1c600ba6db4c1.tar.xz
spack-3c5a4157b019d014a390db30c9a1c600ba6db4c1.zip
py-anuga: add git main version to support build with python@3.5: (#26248)
* py-anuga: add git main version to support build with python@3.5: py-anuga's main branch has been converted to Python-3 recently. * py-triangle: use pypi, py-anuga: Fixed depends and test suite works now
-rw-r--r--var/spack/repos/builtin/packages/py-anuga/package.py52
-rw-r--r--var/spack/repos/builtin/packages/py-triangle/package.py19
2 files changed, 60 insertions, 11 deletions
diff --git a/var/spack/repos/builtin/packages/py-anuga/package.py b/var/spack/repos/builtin/packages/py-anuga/package.py
index 931a45160d..4f88a46f65 100644
--- a/var/spack/repos/builtin/packages/py-anuga/package.py
+++ b/var/spack/repos/builtin/packages/py-anuga/package.py
@@ -13,20 +13,50 @@ class PyAnuga(PythonPackage):
homepage = "https://github.com/GeoscienceAustralia/anuga_core"
url = "https://github.com/GeoscienceAustralia/anuga_core/archive/2.1.tar.gz"
+ git = 'https://github.com/GeoscienceAustralia/anuga_core.git'
+ # The git main branch of the repo is now python3-only
+ version('main', branch='main')
version('2.1', sha256='0e56c4a7d55570d7b2c36fa9b53ee4e7b85f62be0b4c03ad8ab5f51464321d2f')
- variant('mpi', default=True, description='Install anuga_parallel')
-
- # At present AnuGA has only been run and tested using python 2.x.
- # We recommend python 2.7.
- depends_on('python@2.6:2.8', type=('build', 'run'))
- depends_on('py-setuptools@:44', type='build')
- depends_on('py-numpy@:1.16', type=('build', 'run'))
- depends_on('py-netcdf4', type=('build', 'run'))
- depends_on('py-matplotlib@:2', type=('build', 'run'))
- depends_on('gdal@:3.2+python', type=('build', 'run'))
- depends_on('py-pypar', when='+mpi', type=('build', 'run'))
+ # Non-versioned dependencies for Anuga main and future versions based on python@3.5:
+ depends_on('python@3.5:', type=('build', 'run'), when='@2.2:')
+ depends_on('gdal+geos+python', type=('build', 'run'), when='@2.2:')
+ depends_on('py-future', type=('build', 'run'), when='@2.2:')
+ depends_on('py-matplotlib', type=('build', 'run'), when='@2.2:')
+ depends_on('py-numpy', type=('build', 'run'), when='@2.2:')
+ depends_on('py-setuptools', type=('build'), when='@2.2:')
+ # Replaces pyar in python3 anuga:
+ depends_on('py-mpi4py', type=('build', 'run'), when='@2.2:')
+
+ # Version-restricted dependencies for anuga@:2.1, converted to use when='@:2.1':
+ depends_on('python@2.6:2.7.18', type=('build', 'run'), when='@:2.1')
+ depends_on('gdal@:3.2+geos+python', type=('build', 'run'), when='@:2.1')
+ depends_on('py-matplotlib@:2', type=('build', 'run'), when='@:2.1')
+ depends_on('py-numpy@:1.16', type=('build', 'run'), when='@:2.1')
+ depends_on('py-setuptools@:44', type=('build'), when='@:2.1')
+ # Workaround for problem in the original concretizer selecting 3.6, wanting python3:
+ depends_on('py-setuptools-scm@:3.5', type=('build'), when='@:2.1')
+ # pypar is not updated for python3, for python3, py-mpi4py is unsed instead:
+ depends_on('py-pypar', type=('build', 'run'), when='@:2.1')
+
+ # Unversioned dependencies of the python2 and python3-based versions
+ depends_on('py-cython', type=('build'))
+ depends_on('py-netcdf4', type=('build', 'run'))
+ depends_on('py-dill', type=('build', 'test'))
+ depends_on('py-nose', type=('build', 'test'))
+ depends_on('py-scipy', type=('build', 'test'))
+ depends_on('py-triangle', type=('build', 'test'))
+ depends_on('mpi', type=('test', 'run'))
# https://github.com/GeoscienceAustralia/anuga_core/issues/247
conflicts('%apple-clang@12:')
+
+ def setup_run_environment(self, env):
+ if self.run_tests:
+ env.prepend_path('PATH', self.spec['mpi'].prefix.bin)
+
+ install_time_test_callbacks = ['test', 'installtest']
+
+ def installtest(self):
+ python('runtests.py', '--no-build')
diff --git a/var/spack/repos/builtin/packages/py-triangle/package.py b/var/spack/repos/builtin/packages/py-triangle/package.py
new file mode 100644
index 0000000000..a1ea8fe592
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-triangle/package.py
@@ -0,0 +1,19 @@
+# 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)
+
+from spack import *
+
+
+class PyTriangle(PythonPackage):
+ """Python bindings to the triangle library"""
+
+ homepage = 'https://github.com/drufat/triangle'
+ pypi = 'triangle/triangle-20200424.tar.gz'
+
+ version('20200424', sha256='fc207641f8f39986f7d2bee1b91688a588cd235d2e67777422f94e61fece27e9')
+
+ depends_on('triangle', type=('build', 'run'))
+ depends_on('py-numpy', type=('build', 'run'))
+ depends_on('py-cython', type=('build'))