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

Adapt valid-style.yml for JCSDA spack #290

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
65 changes: 13 additions & 52 deletions .github/workflows/valid-style.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
name: style

on:
push:
branches:
- develop
- releases/**
- jcsda_emc_spack_stack
- release/**
pull_request:
branches:
- develop
- releases/**
- jcsda_emc_spack_stack
- release/**
workflow_dispatch:
workflow_call:
inputs:
with_coverage:
required: true
type: string

concurrency:
group: style-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}
cancel-in-progress: true


jobs:
# Validate that the code can be run on all the Python versions
# supported by Spack
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # @v2
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # @v2
with:
python-version: '3.11'
cache: 'pip'
- name: Install Python Packages
run: |
pip install --upgrade pip
pip install --upgrade vermin
- name: vermin (Spack's Core)
run: vermin --backport importlib --backport argparse --violations --backport typing -t=3.6- -vvv lib/spack/spack/ lib/spack/llnl/ bin/
- name: vermin (Repositories)
run: vermin --backport importlib --backport argparse --violations --backport typing -t=3.6- -vvv var/spack/repos
# Run style checks on the files that have been changed
style:
runs-on: ubuntu-latest
Expand All @@ -53,33 +44,3 @@ jobs:
- name: Run style tests
run: |
share/spack/qa/run-style-tests
audit:
uses: ./.github/workflows/audit.yaml
with:
with_coverage: ${{ inputs.with_coverage }}
python_version: '3.11'
# Check that spack can bootstrap the development environment on Python 3.6 - RHEL8
bootstrap-dev-rhel8:
runs-on: ubuntu-latest
container: registry.access.redhat.com/ubi8/ubi
steps:
- name: Install dependencies
run: |
dnf install -y \
bzip2 curl file gcc-c++ gcc gcc-gfortran git gnupg2 gzip \
make patch tcl unzip which xz
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # @v2
- name: Setup repo and non-root user
run: |
git --version
git fetch --unshallow
. .github/workflows/setup_git.sh
useradd spack-test
chown -R spack-test .
- name: Bootstrap Spack development environment
shell: runuser -u spack-test -- bash {0}
run: |
source share/spack/setup-env.sh
spack -d bootstrap now --dev
spack style -t black
spack unit-test -V
63 changes: 33 additions & 30 deletions var/spack/repos/builtin/packages/ectrans/package.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# 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 import *
from spack.package import *


class Ectrans(CMakePackage):
Expand All @@ -17,46 +17,49 @@ class Ectrans(CMakePackage):
git = "https://github.com/ecmwf-ifs/ectrans.git"
url = "https://github.com/ecmwf-ifs/ectrans/archive/1.1.0.tar.gz"

maintainers('climbfuji')
maintainers("climbfuji")

version('develop', branch='develop', no_cache=True)
version('main', branch='main', no_cache=True)
version("develop", branch="develop", no_cache=True)
version("main", branch="main", no_cache=True)
version("1.2.0", sha256="2ee6dccc8bbfcc23faada1d957d141f24e41bb077c1821a7bc2b812148dd336c")
version("1.1.0", sha256="3c9848bb65033fbe6d791084ee347b3adf71d5dfe6d3c11385000017b6469a3e")

variant('build_type', default='RelWithDebInfo',
description='CMake build type',
values=('Debug', 'Release', 'RelWithDebInfo'))
variant(
"build_type",
default="RelWithDebInfo",
description="CMake build type",
values=("Debug", "Release", "RelWithDebInfo"),
)

variant('mpi', default=True, description='Use MPI?')
variant('openmp', default=True, description='Use OpenMP?')
variant("mpi", default=True, description="Use MPI?")
variant("openmp", default=True, description="Use OpenMP?")

variant('double_precision', default=True, description='Support for double precision?')
variant('single_precision', default=True, description='Support for single precision?')
variant("double_precision", default=True, description="Support for double precision?")
variant("single_precision", default=True, description="Support for single precision?")

variant('mkl', default=False, description='Use MKL?')
variant('fftw', default=True, description='Use FFTW?')
variant("mkl", default=False, description="Use MKL?")
variant("fftw", default=True, description="Use FFTW?")

variant('transi', default=True, description='Compile TransI C-interface to trans?')
variant("transi", default=True, description="Compile TransI C-interface to trans?")

depends_on('ecbuild', type='build')
depends_on('mpi', when='+mpi')
depends_on('blas')
depends_on('lapack')
depends_on('fftw-api', when='+fftw')
depends_on('mkl', when='+mkl')
depends_on("ecbuild", type="build")
depends_on("mpi", when="+mpi")
depends_on("blas")
depends_on("lapack")
depends_on("fftw-api", when="+fftw")
depends_on("mkl", when="+mkl")

depends_on('fiat~mpi', when='~mpi')
depends_on('fiat+mpi', when='+mpi')
depends_on("fiat~mpi", when="~mpi")
depends_on("fiat+mpi", when="+mpi")

def cmake_args(self):
args = [
self.define_from_variant('ENABLE_MPI', 'mpi'),
self.define_from_variant('ENABLE_OMP', 'openmp'),
self.define_from_variant('ENABLE_DOUBLE_PRECISION', 'double_precision'),
self.define_from_variant('ENABLE_SINGLE_PRECISION', 'single_precision'),
self.define_from_variant('ENABLE_FFTW', 'fftw'),
self.define_from_variant('ENABLE_MKL', 'mkl'),
self.define_from_variant('ENABLE_TRANSI', 'transi')
self.define_from_variant("ENABLE_MPI", "mpi"),
self.define_from_variant("ENABLE_OMP", "openmp"),
self.define_from_variant("ENABLE_DOUBLE_PRECISION", "double_precision"),
self.define_from_variant("ENABLE_SINGLE_PRECISION", "single_precision"),
self.define_from_variant("ENABLE_FFTW", "fftw"),
self.define_from_variant("ENABLE_MKL", "mkl"),
self.define_from_variant("ENABLE_TRANSI", "transi"),
]
return args
2 changes: 1 addition & 1 deletion var/spack/repos/builtin/packages/fiat/package.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# 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)
Expand Down