Skip to content

Commit

Permalink
Simplify icon4py dependencies (#839)
Browse files Browse the repository at this point in the history
- remove dependencies of EXCLAIM greenline from `py-icon4py`
- run only test relevant for EXCLAIM blueline: tools and icon4py stencils

---------

Co-authored-by: github-actions <[email protected]>
  • Loading branch information
halungge and github-actions authored Oct 12, 2023
1 parent e8d9482 commit 87a8a48
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 32 deletions.
1 change: 0 additions & 1 deletion repos/c2sm/packages/icon/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@ def configure_args(self):
config_vars['LOC_ICON4PY_INTERPOLATION'].append(
self.spec['py-icon4py:interpolation'].headers.
directories[0])
if self.spec['py-icon4py'].version > Version("0.0.8"):
config_vars['LOC_ICON4PY_ADVECTION'].append(
self.spec['py-icon4py:advection'].headers.directories[0])
config_vars['LOC_GRIDTOOLS'].append(
Expand Down
35 changes: 8 additions & 27 deletions repos/c2sm/packages/py-icon4py/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class PyIcon4py(PythonPackage):
version('0.0.5', tag='v0.0.5', git=git)
version('0.0.6', tag='v0.0.6', git=git)
version('0.0.7', tag='v0.0.7', git=git)
version('0.0.8', tag='v0.0.8', git=git)

depends_on('py-wheel', type='build')
depends_on('py-setuptools', type='build')
Expand All @@ -42,20 +41,10 @@ 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')
def patch(self):
spack_pytest_ini = 'jenkins/spack/pytest.ini'
if os.path.exists(spack_pytest_ini):
fs.install(spack_pytest_ini, '.')

# cmake in unit-tests needs this path
def setup_build_environment(self, env):
Expand All @@ -64,13 +53,10 @@ def setup_build_environment(self, env):
def test(self):
# check if all installed module can be imported
super().test()

# unit tests
if 'py-pytest-mpi' in self.spec:
python('-m', 'pytest', '--with-mpi', '-v', '-s', '-m',
'not slow_tests')
else:
python('-m', 'pytest', '-v', '-s', '-n', 'auto')

python('-m', 'pytest', '-v', '-s', '-n', 'auto', '-m',
'not slow_tests')

@property
def headers(self):
Expand Down Expand Up @@ -178,16 +164,11 @@ def install(self, pkg, spec, prefix):
elif self.spec.version == ver('=0.0.6') or self.spec.version == ver(
'=0.0.7'):
build_dirs = ['tools', 'model/atmosphere/dycore', 'model/common/']
elif self.spec.version == ver('=0.0.8'):
build_dirs = [
'tools', 'model/atmosphere/dycore',
'model/atmosphere/diffusion', 'model/driver', 'model/common/'
]
else:
build_dirs = [
'tools', 'model/atmosphere/dycore',
'model/atmosphere/diffusion', 'model/atmosphere/advection',
'model/driver', 'model/common/'
'model/common/'
]

for dir in build_dirs:
Expand Down
4 changes: 0 additions & 4 deletions test/system_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,10 +679,6 @@ def test_install_version_0_0_7(self):
spack_install_and_test(
'py-icon4py @ 0.0.7 %gcc ^[email protected] ^[email protected]')

def test_install_version_0_0_8(self):
spack_install_and_test(
'py-icon4py @ 0.0.8 %gcc ^[email protected] ^[email protected]')


class PyInflectionTest(unittest.TestCase):

Expand Down

0 comments on commit 87a8a48

Please sign in to comment.