Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[py-icon4py] Modifications for merge of greenline #834

Merged
merged 25 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
522cb8c
Rebasing
abishekg7 Sep 15, 2023
c5a42c0
GitHub Action: Apply Pep8-formatting
invalid-email-address Sep 15, 2023
217c5d4
removing recipes that are builtin to v0.20.1
abishekg7 Sep 15, 2023
c156495
Merge branch 'icon4py_rebase' of github.com:C2SM/spack-c2sm into icon…
abishekg7 Sep 15, 2023
fc25002
Update packages.yaml
abishekg7 Sep 15, 2023
9738a75
removing libxml2
abishekg7 Sep 15, 2023
4efc144
removing the pypi arg from version()
abishekg7 Sep 16, 2023
e50047c
GitHub Action: Apply Pep8-formatting
invalid-email-address Sep 16, 2023
85a95cc
Update package.py
abishekg7 Sep 16, 2023
5651098
GitHub Action: Apply Pep8-formatting
invalid-email-address Sep 16, 2023
3496ff1
trying Jonas' fixes
abishekg7 Sep 16, 2023
5127ef4
updating gt4py min requirements
abishekg7 Sep 16, 2023
c0f0233
adding newer py-tabulate
abishekg7 Sep 16, 2023
bb3ca8b
GitHub Action: Apply Pep8-formatting
invalid-email-address Sep 16, 2023
4c79959
renaming v to 2.6.2 to avoid patching includes unncessarily
abishekg7 Sep 17, 2023
1f6378f
Adding tests to integration_test.py
abishekg7 Sep 18, 2023
573da90
GitHub Action: Apply Pep8-formatting
invalid-email-address Sep 18, 2023
aa690ba
Update system_test.py
abishekg7 Sep 18, 2023
2e89a35
Update package.py
abishekg7 Sep 19, 2023
5acc9f3
testing with builtin py-poetry-core
abishekg7 Sep 19, 2023
67b6d95
Removing py-poetry-core test
abishekg7 Sep 19, 2023
af4d884
Removing py-poetry-core test
abishekg7 Sep 19, 2023
7f7c715
updating serialbox version in system tests
abishekg7 Sep 19, 2023
763511d
Adding 'Test' suffixes
abishekg7 Sep 19, 2023
0f1d9e0
Update package.py
jonasjucker Sep 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions repos/c2sm/packages/icon/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,12 @@ def configure_args(self):
self.spec['py-icon4py:atm_dyn_iconam'].headers.directories[0])
config_vars['LOC_ICON4PY_TOOLS'].append(
self.spec['py-icon4py:tools'].headers.directories[0])
if self.spec['py-icon4py'].version > Version("0.0.7"):
config_vars['LOC_ICON4PY_DIFFUSION'].append(
self.spec['py-icon4py:diffusion'].headers.directories[0])
config_vars['LOC_ICON4PY_INTERPOLATION'].append(
self.spec['py-icon4py:interpolation'].headers.
directories[0])
config_vars['LOC_GRIDTOOLS'].append(
self.spec['py-gridtools-cpp:data'].headers.directories[0])
config_vars['GT4PYNVCFLAGS'] = config_vars['NVCFLAGS']
Expand Down
13 changes: 13 additions & 0 deletions repos/c2sm/packages/py-ghex/add_origin_install_rpath.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt
index 7a69da0..13991c2 100644
--- a/bindings/python/CMakeLists.txt
+++ b/bindings/python/CMakeLists.txt
@@ -104,7 +104,7 @@ if(DEFINED SKBUILD_PROJECT_NAME)
# set RPaths
list(GET CMAKE_PREFIX_PATH 0 scikit_build_core_install_path)
set_target_properties(pyghex PROPERTIES
- INSTALL_RPATH "${scikit_build_core_install_path}/ghex/${CMAKE_INSTALL_LIBDIR}")
+ INSTALL_RPATH "$ORIGIN/lib:${scikit_build_core_install_path}/ghex/${CMAKE_INSTALL_LIBDIR}")
set_target_properties(ghex PROPERTIES
INSTALL_RPATH "${scikit_build_core_install_path}/ghex/${CMAKE_INSTALL_LIBDIR}")
if (GHEX_TRANSPORT_BACKEND STREQUAL "LIBFABRIC")
43 changes: 43 additions & 0 deletions repos/c2sm/packages/py-ghex/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright 2013-2020 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 PyGhex(PythonPackage):
"""
Python bindings for Generic exascale-ready library for halo-exchange operations
on variety of grids/meshes.
"""

homepage = 'https://github.com/ghex-org/GHEX'
url = "https://github.com/ghex-org/GHEX/archive/refs/tags/v0.3.0.tar.gz"
git = 'https://github.com/ghex-org/GHEX.git'
maintainers = ['boeschf', 'halungge']

version('0.3.2',
commit='4ae0b8031647816cde3a54a856d37d38e7bdb9ac',
git=git,
submodules=True)
version('0.3.1',
commit='7ced96a69ab502b0ab0eddc1c0d743e06ccde919',
git=git,
submodules=True)

build_directory = 'bindings/python'
import_modules = ['ghex', 'ghex.unstructured']

depends_on("mpi")
depends_on('[email protected]:', type=('build', 'run'))
depends_on('[email protected] +pyproject', type='build')
depends_on('py-pybind11', type=('build', 'run'))
depends_on('py-mpi4py', type=('build', 'run'))
depends_on('[email protected]:', type='build')
depends_on('[email protected]:', type=('build', 'run'))
depends_on('py-numpy', type=('build', 'run'))
depends_on('py-pytest', type=('build', 'run'))

patch("add_origin_install_rpath.patch", when="@0.3.1")
12 changes: 6 additions & 6 deletions repos/c2sm/packages/py-gt4py/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class PyGt4py(PythonPackage):
depends_on('[email protected]:', type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))
depends_on('py-boltons@20.0.0:', type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))
depends_on('py-boltons@20.1:', type=('build', 'run'))
depends_on('[email protected].1:', type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))
depends_on('[email protected].0:', type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))
depends_on('[email protected]:', type=(
Expand All @@ -60,10 +60,10 @@ class PyGt4py(PythonPackage):
depends_on('[email protected]:2.9.2', type=('build', 'run'))

depends_on('[email protected]:', when="@1.1.3:", type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))
depends_on('py-typing-extensions@4.5:', type=('build', 'run'))
depends_on('[email protected].10:', type=('build', 'run'))
depends_on('py-typing-extensions@4.2:4.6', type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))
depends_on('[email protected]:3.0.9', type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))

# Python dependencies from requirements-dev.txt
Expand Down
36 changes: 31 additions & 5 deletions repos/c2sm/packages/py-icon4py/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ class PyIcon4py(PythonPackage):
depends_on('py-pytest', type=('build', 'run'))
depends_on('[email protected]:', type=('build', 'run'))

depends_on('[email protected]:', when='@0.0.8:', type=('build', 'run'))
depends_on('py-netcdf4', when='@0.0.8:', type=('build', 'run'))
depends_on('[email protected]%gcc', when='@0.0.8:', type=('build', 'run'))
depends_on('[email protected]%nvhpc',
when='@0.0.8:',
type=('build', 'run'))
depends_on('[email protected]:', when='@0.0.8:', type=('build', 'run'))
depends_on('py-pytz', when='@0.0.8:', type=('build', 'run'))
depends_on('[email protected]', when='@0.0.8:', type=('build', 'run'))
depends_on('py-wget', when='@0.0.8:', type=('build', 'run'))
depends_on('[email protected] +python',
when='@0.0.8:',
type=('build', 'run'))
depends_on('py-pytest-mpi', when='@0.0.8:', type='build')

# cmake in unit-tests needs this path
def setup_build_environment(self, env):
env.set("CMAKE_INCLUDE_PATH", self.spec['boost'].prefix.include)
Expand All @@ -50,8 +65,7 @@ def test(self):
super().test()

# unit tests
python('-m', 'pytest', '-v', '-s', '-n', 'auto', '--cov',
'--cov-append')
python('-m', 'pytest', '--with-mpi', '-v', '-s')

@property
def headers(self):
Expand All @@ -76,10 +90,16 @@ def headers(self):
'atm_dyn_iconam': 'dycore',
'tools': 'icon4pytools'
},
ver('=main'): {
ver('=0.0.7'): {
'atm_dyn_iconam': 'dycore',
'tools': 'icon4pytools'
}
},
ver('=main'): {
'atm_dyn_iconam': 'dycore',
'tools': 'icon4pytools',
'diffusion': 'diffusion/stencils',
'interpolation': 'interpolation/stencils',
},
}

if len(query_parameters) > 1:
Expand Down Expand Up @@ -143,8 +163,14 @@ def install(self, pkg, spec, prefix):
elif self.spec.version == ver('=0.0.4') or self.spec.version == ver(
'=0.0.5'):
build_dirs = ['common', 'atm_dyn_iconam', 'tools']
else:
elif self.spec.version == ver('=0.0.6') or self.spec.version == ver(
'=0.0.7'):
build_dirs = ['tools', 'model/atmosphere/dycore', 'model/common/']
else:
build_dirs = [
'tools', 'model/atmosphere/dycore',
'model/atmosphere/diffusion', 'model/driver', 'model/common/'
]

for dir in build_dirs:
with fs.working_dir(os.path.join(self.build_directory, dir)):
Expand Down
38 changes: 38 additions & 0 deletions repos/c2sm/packages/py-isort/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2013-2022 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.package import *
from spack.pkg.builtin.py_isort import PyIsort as SpackPyIsort


class PyIsort(SpackPyIsort):
"""A Python utility / library to sort Python imports."""

homepage = "https://github.com/timothycrosley/isort"
pypi = "isort/isort-4.2.15.tar.gz"

version("5.12.0",
sha256=
"8bef7dde241278824a6d83f44a544709b065191b95b6e50894bdc722fcba0504")
version("5.10.1",
sha256=
"e8443a5e7a020e9d7f97f1d7d9cd17c88bcb3bc7e218bf9cf5095fe550be2951")

variant("colors",
default=False,
description="Install colorama for --color support")

depends_on("[email protected]:", when="@5.12:", type=("build", "run"))
depends_on("[email protected]:3", when="@5:5.10", type=("build", "run"))
depends_on("py-poetry-core@1:", type="build")
depends_on("[email protected]:",
when="+colors @5.12:",
type=("build", "run"))
depends_on("[email protected]:0.4",
when="+colors @:5.11",
type=("build", "run"))

# https://github.com/PyCQA/isort/issues/2077
conflicts("^[email protected]:", when="@:5.11.4")
22 changes: 22 additions & 0 deletions repos/c2sm/packages/py-pytest-mpi/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2013-2022 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 PyPytestMpi(PythonPackage):
"""pytest_mpi is a plugin for pytest providing some useful tools when running tests under MPI,
and testing MPI-related code."""

homepage = "https://pytest-mpi.readthedocs.io"
pypi = "pytest-mpi/pytest-mpi-0.6.tar.gz"

maintainers = ['halungge']

version('0.6',
sha256=
'09b3cd3511f8f3cd4d205f54d4a7223724fed0ab68b872ed1123d312152325a9')

depends_on('py-setuptools', type='build')
17 changes: 17 additions & 0 deletions repos/c2sm/packages/py-scikit-build-core/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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)

from spack.package import *
from spack.pkg.builtin.py_scikit_build_core import PyScikitBuildCore as SpackPyScikitBuildCore


class PyScikitBuildCore(SpackPyScikitBuildCore):
jonasjucker marked this conversation as resolved.
Show resolved Hide resolved
"""scikit-build-core is a doubly improved build system generator
for CPython C/C++/Fortran/Cython extensions. It features several
improvements over the classic scikit-build build system generator."""

version("0.5.0",
sha256=
"a42a95029b34b5cf892855342d9b9445c774cb797fcb24c8fc4c2fb42b18dfca")
15 changes: 15 additions & 0 deletions repos/c2sm/packages/py-tabulate/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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)

from spack.package import *
from spack.pkg.builtin.py_tabulate import PyTabulate as SpackPyTabulate


class PyTabulate(SpackPyTabulate):
jonasjucker marked this conversation as resolved.
Show resolved Hide resolved
"""Pretty-print tabular data"""

version("0.8.10",
sha256=
"6c57f3f3dd7ac2782770155f3adb2db0b1a269637e42f27599925e64b114f519")
15 changes: 15 additions & 0 deletions repos/c2sm/packages/serialbox/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from spack.package import *
from spack.pkg.builtin.serialbox import Serialbox as SpackSerialbox


class Serialbox(SpackSerialbox):
"""See upstream package.
Adding version to make compatible with numpy 1.24
"""
git = 'https://github.com/GridTools/serialbox.git'
maintainers = ['halungge', 'skosukhin']

version('2.6.2',
commit='88ac4e4dfc824953d068fe63c8e7b3dd9560a914',
git=git,
submodules=True)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
requests
pytest-xdist
pyyaml
pyyaml
Loading