diff --git a/repos/c2sm/packages/gridtools/package.py b/repos/c2sm/packages/gridtools/package.py index 47ad4b9b35..04d8a1fe4b 100644 --- a/repos/c2sm/packages/gridtools/package.py +++ b/repos/c2sm/packages/gridtools/package.py @@ -6,7 +6,7 @@ from spack import * -class Gridtools(CMakePackage): +class Gridtools(Package): """The GridTools framework is a set of libraries and utilities to develop performance portable applications in the area of weather and climate.""" homepage = "https://github.com/GridTools/gridtools.git" @@ -61,57 +61,7 @@ class Gridtools(CMakePackage): conflicts('%pgi@20:') conflicts('%pgi@:17') - def cmake_args(self): - spec = self.spec - args = [] + phases = ['install'] - args.append('-DGT_ENABLE_BACKEND_MC=OFF') - args.append('-DGT_ENABLE_BACKEND_NAIVE=OFF') - - args.append('-DCMAKE_BUILD_TYPE={0}'.format( - self.spec.variants['build_type'].value)) - - if spec.variants['no_boost_cmake'].value: - args.append('-DBoost_NO_BOOST_CMAKE=ON') - else: - args.append('-DBoost_NO_BOOST_CMAKE=OFF') - - if spec.variants['install_examples'].value: - args.append('-DGT_INSTALL_EXAMPLES=ON') - else: - args.append('-DGT_INSTALL_EXAMPLES=OFF') - - if spec.variants['shared_libs'].value: - args.append('-DBUILD_SHARED_LIBS=ON') - else: - args.append('-DBUILD_SHARED_LIBS=OFF') - - if spec.variants['export_no_package_registery'].value: - args.append('-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON') - else: - args.append('-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=OFF') - - if spec.variants['enable_bindings_gerneration'].value: - args.append('-DGT_ENABLE_BINDINGS_GENERATION=ON') - else: - args.append('-DGT_ENABLE_BINDINGS_GENERATION=OFF') - - if spec.variants['build_testing'].value: - args.append('-DBUILD_TESTING=ON') - else: - args.append('-DBUILD_TESTING=OFF') - - if spec.variants['use_mpi'].value: - args.append('-DGT_USE_MPI=ON') - else: - args.append('-DGT_USE_MPI=OFF') - - if '+cuda' in spec: - args.append('-DCUDA_ARCH=sm_{0}'.format( - self.spec.variants['cuda_arch'].value)) - args.append('-DGT_ENABLE_BACKEND_CUDA=ON') - args.append('-DGT_ENABLE_BACKEND_X86=OFF') - else: - args.append('-DGT_ENABLE_BACKEND_CUDA=OFF') - args.append('-DGT_ENABLE_BACKEND_X86=ON') - return args + def install(self, spec, prefix): + install_tree('include', prefix.include) diff --git a/repos/c2sm/packages/py-gridtools-cpp/package.py b/repos/c2sm/packages/py-gridtools-cpp/package.py index 9807c530d0..c62eee80b6 100644 --- a/repos/c2sm/packages/py-gridtools-cpp/package.py +++ b/repos/c2sm/packages/py-gridtools-cpp/package.py @@ -11,7 +11,7 @@ class PyGridtoolsCpp(PythonPackage): homepage = "https://gridtools.github.io/gridtools/latest/index.html" - pypi = "gridtools-cpp/gridtools-cpp-2.2.2.tar.gz" + pypi = "gridtools-cpp/gridtools-cpp-2.2.3.tar.gz" maintainers = ['samkellerhals'] @@ -19,5 +19,9 @@ class PyGridtoolsCpp(PythonPackage): sha256= "d45316379440b6d96d04b3fb47f6a432946e9f9d906bcb10af51d9a92e95353e") + version("2.2.3", + sha256= + "0bc4b72c9f2786f70c80092bba7bd2eedd216d8c16946b7b32704d248e0d97e6") + depends_on("python@3.8:") depends_on("py-setuptools", type="build") diff --git a/repos/c2sm/packages/py-gt4py/package.py b/repos/c2sm/packages/py-gt4py/package.py index b8c9710e68..afd50cfe25 100644 --- a/repos/c2sm/packages/py-gt4py/package.py +++ b/repos/c2sm/packages/py-gt4py/package.py @@ -15,40 +15,44 @@ class PyGt4py(PythonPackage): url = "ssh://git@github.com/GridTools/gt4py.git" - version('functional', branch='functional', git=url) + version('main', branch='main', git=url) + version('1.1.1', tag='icon4py_20230413', git=url) maintainers = ['samkellerhals'] # Build dependencies depends_on('py-wheel', type='build') depends_on('py-cython', type='build') - depends_on('py-setuptools@40.8.0:', type='build') + depends_on('py-setuptools@65.5.0', type='build') - depends_on('cmake@3.18:', type=('build', 'run')) + depends_on('cmake@3.22:', type=('build', 'run')) depends_on('boost@1.65.1:', type=('build', 'run')) depends_on('clang-format@9:', type=('build', 'run')) # Python dependencies from setup.cfg depends_on('python@3.10:', type=('build', 'run')) - depends_on('py-attrs@20.3:', type=('build', 'run')) + depends_on('py-attrs@21.3:', type=('build', 'run')) depends_on('py-black@22.3.0:', type=('build', 'run')) depends_on('py-boltons@20.0.0:', type=('build', 'run')) - depends_on('py-click@7.1:', type=('build', 'run')) - depends_on('py-devtools@0.5:', type=('build', 'run')) - depends_on('py-frozendict@2.3:', type=('build', 'run')) - depends_on('py-cytoolz@0.11: +cython', type=('build', 'run')) + depends_on('py-cached-property@1.5:', type=('build', 'run')) + depends_on('py-click@8.0.0:', type=('build', 'run')) + depends_on('py-cytoolz@0.12: +cython', type=('build', 'run')) depends_on('py-deepdiff@5.6:', type=('build', 'run')) - depends_on('py-jinja2@2.10:', type=('build', 'run')) + depends_on('py-devtools@0.6:', type=('build', 'run')) + depends_on('py-frozendict@2.3:', type=('build', 'run')) + depends_on('py-gridtools-cpp@2.2.3:', type=('build', 'run')) + depends_on('py-jinja2@3.0.0:', type=('build', 'run')) depends_on('py-lark@1.1.2:', type=('build', 'run')) depends_on('py-mako@1.1:', type=('build', 'run')) - depends_on('py-networkx@2.4:', type=('build', 'run')) depends_on('py-ninja@1.10:', type=('build', 'run')) - depends_on('py-numpy@1.21: ~blas ~lapack', type=('build', 'run')) + depends_on('py-numpy@1.24.2:', type=('build', 'run')) depends_on('py-packaging@20.0:', type=('build', 'run')) depends_on('py-pybind11@2.5:', type=('build', 'run')) + depends_on('py-tabulate@0.8:', type=('build', 'run')) + depends_on('py-typing-extensions@4.5:', type=('build', 'run')) depends_on('py-toolz@0.12.0:', type=('build', 'run')) - depends_on('py-typing-extensions@4.2:', type=('build', 'run')) depends_on('py-xxhash@1.4.4:', type=('build', 'run')) + depends_on('py-hypothesis@6.0.0:', type=('build', 'run')) # Python dependencies from requirements-dev.txt # Convert to type=('test') ? @@ -58,20 +62,16 @@ class PyGt4py(PythonPackage): depends_on('py-psutil@5.0:', type=('build', 'run')) depends_on('py-pytest-cache@1.0:', type=('build', 'run')) depends_on('py-pytest-cov@2.8:', type=('build', 'run')) - depends_on('py-pytest-factoryboy@2.0:', type=('build', 'run')) - depends_on('py-gridtools-cpp@2.2.2:', type=('build', 'run')) - depends_on('py-pytest@6.1:', type=('build', 'run')) + depends_on('py-pytest-factoryboy@2.0.3:', type=('build', 'run')) + depends_on('py-pytest@7.0:', type=('build', 'run')) + # setup.cfg requires newer version, but not available yet depends_on('py-tox@3.14:', type=('build', 'run')) - # missing version constraint: pytest-xdist[psutil]>=2.2 + # missing version constraint: pytest-xdist[psutil]>=2.4 depends_on('py-pytest-xdist', type=('build', 'run')) - # pytest fails with: - #__main__.py: error: unrecognized arguments: --cov-config=setup.cfg - patch('patches/functional/rm_cov_config_arg.patch', when='@functional') - @run_after('install') @on_package_attributes(run_tests=True) def install_test(self): python('-m', 'pytest', '-v', '-s', '-n', 'auto', '--cov', - '--cov-append', 'tests') + '--cov-append', 'tests/next_tests', 'tests/eve_tests') diff --git a/repos/c2sm/packages/py-icon4py/package.py b/repos/c2sm/packages/py-icon4py/package.py index 6bf80af700..fe41a071bd 100644 --- a/repos/c2sm/packages/py-icon4py/package.py +++ b/repos/c2sm/packages/py-icon4py/package.py @@ -13,12 +13,14 @@ class PyIcon4py(PythonPackage): components for weather and climate models.""" url = "git@github.com:C2SM/icon4py.git" + git = 'ssh://git@github.com/C2SM/icon4py.git' homepage = "https://github.com/C2SM/icon4py" maintainers = ['samkellerhals'] - version('main', branch='main', git='ssh://git@github.com/C2SM/icon4py.git') + version('main', branch='main', git=git) + version('0.0.3', tag='v0.0.3', git=git) depends_on('py-wheel', type='build') depends_on('py-setuptools', type='build') @@ -29,6 +31,11 @@ class PyIcon4py(PythonPackage): depends_on('py-fprettify@0.3.7:', type=('build', 'run')) depends_on('py-gt4py', type=('build', 'run')) depends_on('py-pytest', type=('build', 'run')) + depends_on('boost@1.65.1:', type=('build', 'run')) + + # cmake in unit-tests needs this path + def setup_build_environment(self, env): + env.set("CMAKE_INCLUDE_PATH", self.spec['boost'].prefix.include) def install(self, spec, prefix): """Install everything from build directory.""" @@ -47,7 +54,9 @@ def install(self, spec, prefix): args.append('.') pip = inspect.getmodule(self).pip - build_dirs = ['common', 'pyutils', 'testutils', 'atm_dyn_iconam'] + build_dirs = [ + 'common', 'pyutils', 'testutils', 'liskov', 'atm_dyn_iconam' + ] for dir in build_dirs: with working_dir(os.path.join(self.stage.source_path, dir)): pip(*args) diff --git a/repos/c2sm/packages/py-numpy/package.py b/repos/c2sm/packages/py-numpy/package.py new file mode 100644 index 0000000000..e1d8804e17 --- /dev/null +++ b/repos/c2sm/packages/py-numpy/package.py @@ -0,0 +1,22 @@ +from spack.package import * +from spack.pkg.builtin.py_numpy import PyNumpy as SpackPyNumpy + + +class PyNumpy(SpackPyNumpy): + """NumPy is the fundamental package for scientific computing with Python. + It contains among other things: a powerful N-dimensional array object, + sophisticated (broadcasting) functions, tools for integrating C/C++ and + Fortran code, and useful linear algebra, Fourier transform, and random + number capabilities""" + + version('1.24.2', + sha256= + '003a9f530e880cb2cd177cba1af7220b9aa42def9c4afc2a2fc3ee6be7eb2b22') + + def url_for_version(self, version): + url = "https://files.pythonhosted.org/packages/source/n/numpy/numpy-{}.{}" + if version >= Version("1.23"): + ext = "tar.gz" + else: + ext = "zip" + return url.format(version, ext) diff --git a/repos/c2sm/packages/py-poetry-core/package.py b/repos/c2sm/packages/py-poetry-core/package.py new file mode 100644 index 0000000000..5e688b3933 --- /dev/null +++ b/repos/c2sm/packages/py-poetry-core/package.py @@ -0,0 +1,14 @@ +from spack.package import * +from spack.pkg.builtin.py_poetry_core import PyPoetryCore as SpackPyPoetryCore + + +class PyPoetryCore(SpackPyPoetryCore): + """Poetry PEP 517 Build Backend.""" + + # https://github.com/python-poetry/poetry/issues/5547 + def setup_build_environment(self, env): + env.set("GIT_DIR", join_path(self.stage.source_path, ".git")) + + def setup_dependent_build_environment(self, env, dependent_spec): + env.set("GIT_DIR", + join_path(dependent_spec.package.stage.source_path, ".git")) diff --git a/repos/c2sm/packages/py-pytest/package.py b/repos/c2sm/packages/py-pytest/package.py new file mode 100644 index 0000000000..716f950535 --- /dev/null +++ b/repos/c2sm/packages/py-pytest/package.py @@ -0,0 +1,10 @@ +from spack.package import * +from spack.pkg.builtin.py_pytest import PyPytest as SpackPyPytest + + +class PyPytest(SpackPyPytest): + """pytest: simple powerful testing with Python.""" + + version('7.0.0', + sha256= + 'dad48ffda394e5ad9aa3b7d7ddf339ed502e5e365b1350e0af65f4a602344b11') diff --git a/repos/c2sm/packages/py-setuptools/package.py b/repos/c2sm/packages/py-setuptools/package.py new file mode 100644 index 0000000000..be0afe98d5 --- /dev/null +++ b/repos/c2sm/packages/py-setuptools/package.py @@ -0,0 +1,14 @@ +from spack.package import * +from spack.pkg.builtin.py_setuptools import PySetuptools as SpackPySetuptools + + +class PySetuptools(SpackPySetuptools): + """A Python utility that aids in the process of downloading, building, + upgrading, installing, and uninstalling Python packages.""" + + version('65.5.0', + sha256= + '512e5536220e38146176efb833d4a62aa726b7bbff82cfbc8ba9eaa3996e0b17') + version('60.6.0', + sha256= + 'eb83b1012ae6bf436901c2a2cee35d45b7260f31fd4b65fd1e50a9f99c11d7f8') diff --git a/repos/c2sm/packages/py-typing-extensions/package.py b/repos/c2sm/packages/py-typing-extensions/package.py index d36ebab6c2..136f30de18 100644 --- a/repos/c2sm/packages/py-typing-extensions/package.py +++ b/repos/c2sm/packages/py-typing-extensions/package.py @@ -5,6 +5,9 @@ class PyTypingExtensions(SpackPyTypingExtensions): """Backported and Experimental Type Hints for Python 3.7+""" + version("4.5.0", + sha256= + "5cb5f4a79139d699607b3ef622a1dedafa84e115ab0024e0d9c044a9479ca7cb") version("4.2.0", sha256= "f1c24655a0da0d1b67f07e17a5e6b2a105894e6824b92096378bb3668ef02376") diff --git a/test/system_test.py b/test/system_test.py index dcbaabfac3..5d8b493230 100644 --- a/test/system_test.py +++ b/test/system_test.py @@ -332,22 +332,19 @@ def test_install_version_0_1(self): spack_install_and_test('omni-xmod-pool @0.1') -@pytest.mark.no_balfrin # Irrelevant -@pytest.mark.no_daint # py-isort install fails with: No module named 'poetry'. @pytest.mark.no_tsa # Irrelevant class PyGt4pyTest(unittest.TestCase): - def test_install_version_functional(self): - spack_install_and_test('py-gt4py %gcc') + def test_install_version_1_1_1(self): + spack_install_and_test('py-gt4py @ 1.1.1 %gcc ^python@3.10.4') -@pytest.mark.no_balfrin # py-isort install fails with: No module named 'poetry'. -@pytest.mark.no_daint # py-isort install fails @pytest.mark.no_tsa # py-isort install fails with: No module named 'poetry'. class PyIcon4pyTest(unittest.TestCase): - def test_install_version_main(self): - spack_install_and_test('py-icon4py @main %gcc') + def test_install_version_0_0_3(self): + spack_install_and_test( + 'py-icon4py @ 0.0.3 %gcc ^py-gt4py@1.1.1 ^python@3.10.4') class ZLibNGTest(unittest.TestCase):