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
This commit is contained in:
bernhardkaindl 2021-09-28 17:37:09 +02:00 committed by GitHub
parent d00c9b47f2
commit 3c5a4157b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 10 deletions

View File

@ -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')
# 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:')
# 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'))
# 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')

View File

@ -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'))