From 3096809aafa848ba384fd787430f4562092685bd Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 21 Nov 2023 14:04:21 -0700 Subject: [PATCH 01/21] New package py-ansimarkup --- .../builtin/packages/py-ansimarkup/package.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 var/spack/repos/builtin/packages/py-ansimarkup/package.py diff --git a/var/spack/repos/builtin/packages/py-ansimarkup/package.py b/var/spack/repos/builtin/packages/py-ansimarkup/package.py new file mode 100644 index 00000000000000..cd02faf7c60319 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-ansimarkup/package.py @@ -0,0 +1,21 @@ +# 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 * + + +class PyAnsimarkup(PythonPackage): + """Produce colored terminal text with an xml-like markup""" + + homepage = "https://github.com/gvalkov/python-ansimarkup" + pypi = "ansimarkup/ansimarkup-2.1.0.tar.gz" + + maintainers("climbfuji") + + version("2.1.0", sha256="7b3e3d93fecc5b64d23a6e8eb96dbc8b0b576a211829d948afb397d241a8c51b") + + depends_on("python@3.6:", type=("build", "run")) + depends_on("py-setuptools@61:", type="build") + depends_on("py-colorama", type=("build", "run")) From 52b511923c5b4dc85ad3fa79fe6853022f987d35 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 21 Nov 2023 14:05:03 -0700 Subject: [PATCH 02/21] New package py-metomi-isodatetime --- .../packages/py-metomi-isodatetime/package.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 var/spack/repos/builtin/packages/py-metomi-isodatetime/package.py diff --git a/var/spack/repos/builtin/packages/py-metomi-isodatetime/package.py b/var/spack/repos/builtin/packages/py-metomi-isodatetime/package.py new file mode 100644 index 00000000000000..f8f407ad295aa0 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-metomi-isodatetime/package.py @@ -0,0 +1,18 @@ +# 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 * + + +class PyMetomiIsodatetime(PythonPackage): + """Python ISO 8601 date time parser and data model/manipulation utilities""" + + homepage = "https://github.com/metomi/isodatetime" + pypi = "metomi-isodatetime/metomi-isodatetime-1!3.1.0.tar.gz" + + maintainers("climbfuji") + + version("3.1.0", sha256="2ec15eb9c323d5debd0678f33af99bc9a91aa0b534ee5f65f3487aed518ebf2d") + depends_on("py-setuptools", type="build") From f9a635eb374798894534b9bea774424efdf7276d Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 21 Nov 2023 14:06:11 -0700 Subject: [PATCH 03/21] New package py-graphql-relay --- .../packages/py-graphql-relay/package.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 var/spack/repos/builtin/packages/py-graphql-relay/package.py diff --git a/var/spack/repos/builtin/packages/py-graphql-relay/package.py b/var/spack/repos/builtin/packages/py-graphql-relay/package.py new file mode 100644 index 00000000000000..f2a3b0e9c052df --- /dev/null +++ b/var/spack/repos/builtin/packages/py-graphql-relay/package.py @@ -0,0 +1,24 @@ +# 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 * + + +class PyGraphqlRelay(PythonPackage): + """A library to help construct a graphql-py server supporting react-relay""" + + homepage = "https://github.com/graphql-python/graphql-relay-py" + pypi = "graphql-relay/graphql-relay-3.2.0.tar.gz" + + maintainers("climbfuji") + + version("2.0.1", sha256="870b6b5304123a38a0b215a79eace021acce5a466bf40cd39fa18cb8528afabb") + + depends_on("python@3.6:3", type=("build", "run")) + depends_on("py-setuptools", type="build") + depends_on("py-six@1.12:", type=("build", "run")) + depends_on("py-graphql-core@2.2:3", type=("build", "run")) + depends_on("py-promise@2.2:3", type=("build", "run")) From cfe703d1ca93b22800a73628d2f28c4948c2d7a8 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 21 Nov 2023 14:06:35 -0700 Subject: [PATCH 04/21] Add py-aniso8601@7.0.0 --- var/spack/repos/builtin/packages/py-aniso8601/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/py-aniso8601/package.py b/var/spack/repos/builtin/packages/py-aniso8601/package.py index f5659a200847e9..17946429114297 100644 --- a/var/spack/repos/builtin/packages/py-aniso8601/package.py +++ b/var/spack/repos/builtin/packages/py-aniso8601/package.py @@ -13,5 +13,6 @@ class PyAniso8601(PythonPackage): pypi = "aniso8601/aniso8601-9.0.1.tar.gz" version("9.0.1", sha256="72e3117667eedf66951bb2d93f4296a56b94b078a8a95905a052611fb3f1b973") + version("7.0.0", sha256="513d2b6637b7853806ae79ffaca6f3e8754bdd547048f5ccc1420aec4b714f1e") depends_on("py-setuptools", type="build") From 27263653e58ceec75db5e0e02a7f6ff49ab604c1 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 21 Nov 2023 14:17:58 -0700 Subject: [PATCH 05/21] New package py-graphene --- .../builtin/packages/py-graphene/package.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 var/spack/repos/builtin/packages/py-graphene/package.py diff --git a/var/spack/repos/builtin/packages/py-graphene/package.py b/var/spack/repos/builtin/packages/py-graphene/package.py new file mode 100644 index 00000000000000..aa0e52d34b3fa6 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-graphene/package.py @@ -0,0 +1,22 @@ +# 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 * + + +class PyGraphene(PythonPackage): + """GraphQL framework for Python""" + + homepage = "https://graphene-python.org/" + pypi = "graphene/graphene-2.1.9.tar.gz" + maintainers("climbfuji") + + version("2.1.9", sha256="b9f2850e064eebfee9a3ef4a1f8aa0742848d97652173ab44c82cc8a62b9ed93") + + depends_on("py-setuptools", type="build") + depends_on("py-graphql-core@2.1:2", type=("build", "run")) + depends_on("py-graphql-relay@2:2", type=("build", "run")) + depends_on("py-aniso8601@3:7", type=("build", "run")) + depends_on("py-six@1.10:1", type=("build", "run")) From 5918da224b2d3d1cc93d8f98e309dabfe9d86568 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 21 Nov 2023 14:19:14 -0700 Subject: [PATCH 06/21] New package py-cylc-flow --- .../builtin/packages/py-cylc-flow/package.py | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 var/spack/repos/builtin/packages/py-cylc-flow/package.py diff --git a/var/spack/repos/builtin/packages/py-cylc-flow/package.py b/var/spack/repos/builtin/packages/py-cylc-flow/package.py new file mode 100644 index 00000000000000..90ba590dfed0a6 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-cylc-flow/package.py @@ -0,0 +1,41 @@ +# 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 * + + +class PyCylcFlow(PythonPackage): + """A workflow engine for cycling systems""" + + homepage = "https://cylc.github.io" + pypi = "cylc-flow/cylc-flow-8.2.3.tar.gz" + + maintainers("climbfuji") + + version("8.2.3", sha256="dd5bea9e4b8dad00edd9c3459a38fb778e5a073da58ad2725bc9b84ad718e073") + + # Python dependencies + depends_on("python@3.7:", type=("build", "run")) + #tomli>=2; python_version < "3.11" - is the following correct? + depends_on("py-tomli@2:", type="build", when="^python@:3.10") + depends_on("py-ansimarkup@1:", type=("build", "run")) + depends_on("py-async-timeout@3:", type=("build", "run")) + depends_on("py-colorama@0.4:0", type=("build", "run")) + depends_on("py-graphene@2.1:2", type=("build", "run")) + depends_on("py-jinja2@3", type=("build", "run")) + depends_on("py-metomi-isodatetime@3:3.1", type=("build", "run")) + depends_on("py-protobuf@4.21.2:4.21", type=("build", "run")) + depends_on("py-psutil@5.6:", type=("build", "run")) + depends_on("py-pyzmq@22:", type=("build", "run")) + depends_on("py-setuptools@49:", type="build") + conflicts("py-setuptools@67") + #importlib_metadata; python_version < "3.8" - is the following correct? + depends_on("py-importlib-metadata", type=("build", "run"), when="^python@:3.7") + depends_on("py-urwid@2", type=("build", "run")) + depends_on("py-rx", type=("build", "run")) + depends_on("py-promise", type=("build", "run")) + + # Non-Python dependencies + depends_on("graphviz", type="run") From 47f640d46ab812b37c13b5808b871f2155405e53 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 21 Nov 2023 15:00:43 -0700 Subject: [PATCH 07/21] Add py-mepo --- .../repos/builtin/packages/py-mepo/package.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 var/spack/repos/builtin/packages/py-mepo/package.py diff --git a/var/spack/repos/builtin/packages/py-mepo/package.py b/var/spack/repos/builtin/packages/py-mepo/package.py new file mode 100644 index 00000000000000..ac250adf96b70a --- /dev/null +++ b/var/spack/repos/builtin/packages/py-mepo/package.py @@ -0,0 +1,19 @@ +# 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 * + + +class PyMepo(PythonPackage): + """Tool to manage (m)ultiple git r(epo)sitories""" + + homepage = "https://github.com/GEOS-ESM/mepo" + url = "https://github.com/GEOS-ESM/mepo/archive/refs/tags/v1.51.1.tar.gz" + + maintainers("mathomp4", "climbfuji") + + version("1.51.1", sha256="543c1e7487afb2d62e5e8c8a2f69a85af1b1951f588f3dfc7471763e90847360") + + depends_on("py-pyyaml@5.4:", type=("build", "run")) From 8b893aff01fe0c784596042338353b3f447199a9 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Mon, 4 Dec 2023 17:40:41 +0100 Subject: [PATCH 08/21] py-metomi-isodatetime: fix url parsing --- .../repos/builtin/packages/py-metomi-isodatetime/package.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/var/spack/repos/builtin/packages/py-metomi-isodatetime/package.py b/var/spack/repos/builtin/packages/py-metomi-isodatetime/package.py index 241bb1f46ce628..02d38147e22715 100644 --- a/var/spack/repos/builtin/packages/py-metomi-isodatetime/package.py +++ b/var/spack/repos/builtin/packages/py-metomi-isodatetime/package.py @@ -18,3 +18,7 @@ class PyMetomiIsodatetime(PythonPackage): version("3.0.0", sha256="2141e8aaa526ea7f7f1cb883e6c8ed83ffdab73269658d84d0624f63a6e1357e") depends_on("py-setuptools", type="build") + + def url_for_version(self, version): + url = "https://files.pythonhosted.org/packages/source/m/metomi-isodatetime/metomi-isodatetime-1!{}.tar.gz" + return url.format(version) From b3c81683a4fee225f1a4958acc9ff079ef1120bc Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 4 Dec 2023 20:24:15 -0700 Subject: [PATCH 09/21] Update py-werkzeug version dependency for py-graphene-tornado@2.6.1 --- var/spack/repos/builtin/packages/py-graphene-tornado/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/py-graphene-tornado/package.py b/var/spack/repos/builtin/packages/py-graphene-tornado/package.py index ba44045b4c6d79..74e6cf83e2a070 100644 --- a/var/spack/repos/builtin/packages/py-graphene-tornado/package.py +++ b/var/spack/repos/builtin/packages/py-graphene-tornado/package.py @@ -21,5 +21,5 @@ class PyGrapheneTornado(PythonPackage): depends_on("py-graphene@2.1:2", type=("build", "run")) depends_on("py-jinja2@2.10.1:", type=("build", "run")) depends_on("py-tornado@5.1.0:", type=("build", "run")) - depends_on("py-werkzeug@0.12.2", type=("build", "run")) + depends_on("py-werkzeug@0.15.3", type=("build", "run")) depends_on("py-pytest", type=("build")) From b91f89cd20da060e5bfe031477ff8feeccea1667 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 5 Dec 2023 08:32:43 -0700 Subject: [PATCH 10/21] Add note on diverging version requirements for py-werkzeug in py-graphene-tornado --- .../repos/builtin/packages/py-graphene-tornado/package.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/var/spack/repos/builtin/packages/py-graphene-tornado/package.py b/var/spack/repos/builtin/packages/py-graphene-tornado/package.py index 74e6cf83e2a070..d54b40676c9b1f 100644 --- a/var/spack/repos/builtin/packages/py-graphene-tornado/package.py +++ b/var/spack/repos/builtin/packages/py-graphene-tornado/package.py @@ -21,5 +21,8 @@ class PyGrapheneTornado(PythonPackage): depends_on("py-graphene@2.1:2", type=("build", "run")) depends_on("py-jinja2@2.10.1:", type=("build", "run")) depends_on("py-tornado@5.1.0:", type=("build", "run")) + # py-werkzeug version requirements differ between setup.py (0.12.2) + # and requirements.txt (0.15.3); the latter seems to be correct, + # see also https://github.com/spack/spack/pull/41426 depends_on("py-werkzeug@0.15.3", type=("build", "run")) depends_on("py-pytest", type=("build")) From 7853d5c3ac7c10c7141f1714a8e3d97429a1e1df Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 5 Dec 2023 11:11:29 -0700 Subject: [PATCH 11/21] Update logic in for 'spack stack setup-meta-modules (lib/jcsda-emc/spack-stack/stack/meta_modules.py) for finding Python --- .../spack-stack/stack/meta_modules.py | 114 ++++++------------ 1 file changed, 39 insertions(+), 75 deletions(-) diff --git a/lib/jcsda-emc/spack-stack/stack/meta_modules.py b/lib/jcsda-emc/spack-stack/stack/meta_modules.py index f5cc260ef9b4f2..a740c0fb15085f 100755 --- a/lib/jcsda-emc/spack-stack/stack/meta_modules.py +++ b/lib/jcsda-emc/spack-stack/stack/meta_modules.py @@ -137,6 +137,8 @@ def get_matched_dict(root_dir, candidate_list, sub_candidate_list=None): matched_dict[matched_name] = [matched_version] else: matched_dict[matched_name].append(matched_version) + # Dedupe + matched_dict[matched_name] = list(set(matched_dict[matched_name])) # MPI providers or example depend on compilers else: if matched_name not in matched_dict.keys(): @@ -697,82 +699,46 @@ def setup_meta_modules(): f.write(module_content) logging.info(" ... writing {}".format(mpi_module_file)) - try: - del package_name - except: - pass # Create python modules. Need to accommodate both external # Python distributions and spack-built Python distributions. - # If there is no package config info for Python, then we are - # using a spack-built Python without knowing the version - not supported. - if not "python" in package_config.keys(): - raise Exception( - """No information on Python in package config. For external -Python distributions, specify complete specifications. For spack-built -Python, list the correct version in the package config""" - ) - else: - package_name = "python" - if "externals" in package_config[package_name].keys(): - # Loop through all external specs and find the - # latest version, this is what spack is using - spack_python_build = False - python_version = None - for i in range(len(package_config[package_name]["externals"])): - (python_name, python_version_test) = get_name_and_version_from_spec( - package_config[package_name]["externals"][i]["spec"] - ) - if not python_version or versiontuple(python_version_test) > versiontuple( - python_version - ): - python_version = python_version_test - python_package_config = package_config[python_name]["externals"][i] - logging.debug(" ... using external python version {}".format(python_version)) - else: - spack_python_build = True - python_name = "python" - python_version = None - python_package_config = None - # Loop through versions, pick the most-recent - for python_version_test in package_config[package_name]["version"]: - if not python_version or versiontuple(python_version_test) > versiontuple( - python_version - ): - python_version = python_version_test - logging.debug(" ... using spack-built python version {}".format(python_version)) - # Check that the Python version we determined is indeed what's installed - python_candidate_list = ["python@{}".format(python_version)] - for compiler_name in compiler_dict.keys(): - for compiler_version in compiler_dict[compiler_name]: - compiler_install_dir = os.path.join( - install_dir, compiler_name, compiler_version - ) - python_dict = get_matched_dict(compiler_install_dir, python_candidate_list) - logging.info(" ... stack python providers: '{}'".format(python_dict)) - if not python_dict: - user_input = input( - "No matching Python version found found, proceed without creating Python modules? (yes/no): " - ) - if not user_input.lower() in ["yes", "y"]: - raise Exception( - """"No matching Python version found. Make sure that the -Python version in the package config matches what spack installed.""" - ) - else: - logging.info( - "Metamodule generation completed successfully in {}".format( - meta_module_dir - ) - ) - return + python_dict = {} + python_name = "python" + + # First, collect all Python packages in the environment + for spec in ev.installed_specs(): + if spec.name == python_name: + compiler_name = spec.compiler.name + compiler_version = str(spec.compiler.version) + if not compiler_name in python_dict.keys(): + python_dict[compiler_name] = {} + if compiler_version in python_dict[compiler_name].keys(): + raise Exception("Duplicate Python packages for compiler {spec.compiler}") + python_dict[compiler_name][compiler_version] = spec for compiler_name in compiler_dict.keys(): for compiler_version in compiler_dict[compiler_name]: + if not compiler_name in python_dict.keys() or \ + not compiler_version in python_dict[compiler_name].keys(): + user_input = input( + f"No Python version found for compiler {compiler_name}@{compiler_version}, proceed without creating Python modules? (yes/no): " + ) + if not user_input.lower() in ["yes", "y"]: + raise Exception(f"No Python version found for compiler {compiler_name}@{compiler_version}.") + else: + continue + spec = python_dict[compiler_name][compiler_version] + python_version = str(spec.version) logging.info( " ... configuring stack python interpreter {}@{} for compiler {}@{}".format( - python_name, python_version, compiler_name, compiler_version + python_name, python_version, compiler_name, compiler_version) ) - ) + + if spec.external: + logging.debug(f" ... using external python version {python_version}") + prefix = spec.external_path + modules = spec.external_modules + else: + logging.debug(f" ... using spack-built python version {python_version}") # Path and name for lua module file python_module_dir = os.path.join( @@ -783,12 +749,12 @@ def setup_meta_modules(): ) substitutes = SUBSTITUTES_TEMPLATE.copy() - # - if spack_python_build: + # Spack-built Python vs external Python + if not spec.external: module = "python/{}".format(python_version) # Load spack python module substitutes["MODULELOADS"] += module_load_command(module_choice, module) - elif "modules" in python_package_config.keys(): + elif modules: # Existing non-spack modules to load for module in python_package_config["modules"]: substitutes["MODULELOADS"] += module_load_command(module_choice, module) @@ -798,14 +764,12 @@ def setup_meta_modules(): logging.debug(" ... ... MODULELOADS: {}".format(substitutes["MODULELOADS"])) logging.debug(" ... ... MODULEPREREQS: {}".format(substitutes["MODULEPREREQS"])) # python_name_ROOT - replace "-" in python_name with "_" for environment variables - if "prefix" in python_package_config.keys(): - prefix = python_package_config["prefix"] + if prefix: substitutes["PYTHONROOT"] = setenv_command( module_choice, python_name.replace("-", "_") + "_ROOT", prefix ) logging.debug(" ... ... PYTHONROOT: {}".format(substitutes["PYTHONROOT"])) - elif "prefix" in python_package_config.keys(): - prefix = python_package_config["prefix"] + elif prefix: # PATH bindir = os.path.join(prefix, "bin") if os.path.isdir(bindir): From b32d6d59ccc3c6d3881df99174cd8aadf266b8ea Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 7 Dec 2023 08:29:28 -0700 Subject: [PATCH 12/21] Remove unnecessary and wrong package py-mepo --- .../repos/builtin/packages/py-mepo/package.py | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 var/spack/repos/builtin/packages/py-mepo/package.py diff --git a/var/spack/repos/builtin/packages/py-mepo/package.py b/var/spack/repos/builtin/packages/py-mepo/package.py deleted file mode 100644 index ac250adf96b70a..00000000000000 --- a/var/spack/repos/builtin/packages/py-mepo/package.py +++ /dev/null @@ -1,19 +0,0 @@ -# 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 * - - -class PyMepo(PythonPackage): - """Tool to manage (m)ultiple git r(epo)sitories""" - - homepage = "https://github.com/GEOS-ESM/mepo" - url = "https://github.com/GEOS-ESM/mepo/archive/refs/tags/v1.51.1.tar.gz" - - maintainers("mathomp4", "climbfuji") - - version("1.51.1", sha256="543c1e7487afb2d62e5e8c8a2f69a85af1b1951f588f3dfc7471763e90847360") - - depends_on("py-pyyaml@5.4:", type=("build", "run")) From 1fe069dfdbdf4f1a6cddc76b27b41df7a4719177 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 7 Dec 2023 13:36:29 -0700 Subject: [PATCH 13/21] Fix style errors in lib/jcsda-emc/spack-stack/stack/meta_modules.py --- lib/jcsda-emc/spack-stack/stack/meta_modules.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/jcsda-emc/spack-stack/stack/meta_modules.py b/lib/jcsda-emc/spack-stack/stack/meta_modules.py index a740c0fb15085f..f662c1f9f87d8e 100755 --- a/lib/jcsda-emc/spack-stack/stack/meta_modules.py +++ b/lib/jcsda-emc/spack-stack/stack/meta_modules.py @@ -717,21 +717,26 @@ def setup_meta_modules(): for compiler_name in compiler_dict.keys(): for compiler_version in compiler_dict[compiler_name]: - if not compiler_name in python_dict.keys() or \ - not compiler_version in python_dict[compiler_name].keys(): + if ( + not compiler_name in python_dict.keys() + or not compiler_version in python_dict[compiler_name].keys() + ): user_input = input( f"No Python version found for compiler {compiler_name}@{compiler_version}, proceed without creating Python modules? (yes/no): " - ) + ) if not user_input.lower() in ["yes", "y"]: - raise Exception(f"No Python version found for compiler {compiler_name}@{compiler_version}.") + raise Exception( + f"No Python version found for compiler {compiler_name}@{compiler_version}." + ) else: continue spec = python_dict[compiler_name][compiler_version] python_version = str(spec.version) logging.info( " ... configuring stack python interpreter {}@{} for compiler {}@{}".format( - python_name, python_version, compiler_name, compiler_version) + python_name, python_version, compiler_name, compiler_version ) + ) if spec.external: logging.debug(f" ... using external python version {python_version}") From 6c5d71ac98eecae8d080b35694b66534e1f5e618 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 7 Dec 2023 14:10:23 -0700 Subject: [PATCH 14/21] Add variants ecflow and cylc for ewok-env --- .../jcsda-emc-bundles/packages/ewok-env/package.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/jcsda-emc-bundles/packages/ewok-env/package.py b/var/spack/repos/jcsda-emc-bundles/packages/ewok-env/package.py index fc0b4a54a1b5c7..f08e452a2191fa 100644 --- a/var/spack/repos/jcsda-emc-bundles/packages/ewok-env/package.py +++ b/var/spack/repos/jcsda-emc-bundles/packages/ewok-env/package.py @@ -17,6 +17,10 @@ class EwokEnv(BundlePackage): version("1.0.0") + # Variants for workflow engines + variant("ecflow", default=True, description="Use ecflow workflow engine") + variant("cylc", default=False, description="Use cylc workflow engine" + # Variants defining repositories that are not yet publicly available variant("solo", default=False, description="Build solo (general tools for Python programmers)") variant( @@ -41,7 +45,12 @@ class EwokEnv(BundlePackage): depends_on("py-ruamel-yaml-clib", type="run") # Workflow engines - depends_on("ecflow", type="run") + with when("+ecflow"): + depends_on("ecflow", type="run") + with when("+cylc"): + depends_on("py-cylc-flow", type="run") + depends_on("py-cylc-rose", type="run") + depends_on("py-cylc-uiserver", type="run") # R2D2 mysql backend depends_on("mysql", type="run") From 6d014848da0b45a95360f0db96e44333437d3884 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 11 Dec 2023 07:42:36 -0700 Subject: [PATCH 15/21] Fix typo in var/spack/repos/jcsda-emc-bundles/packages/ewok-env/package.py --- var/spack/repos/jcsda-emc-bundles/packages/ewok-env/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/jcsda-emc-bundles/packages/ewok-env/package.py b/var/spack/repos/jcsda-emc-bundles/packages/ewok-env/package.py index f08e452a2191fa..d0c82cbca9f742 100644 --- a/var/spack/repos/jcsda-emc-bundles/packages/ewok-env/package.py +++ b/var/spack/repos/jcsda-emc-bundles/packages/ewok-env/package.py @@ -19,7 +19,7 @@ class EwokEnv(BundlePackage): # Variants for workflow engines variant("ecflow", default=True, description="Use ecflow workflow engine") - variant("cylc", default=False, description="Use cylc workflow engine" + variant("cylc", default=False, description="Use cylc workflow engine") # Variants defining repositories that are not yet publicly available variant("solo", default=False, description="Build solo (general tools for Python programmers)") From d75abcc80043d727a4249703ab04776272c0d741 Mon Sep 17 00:00:00 2001 From: Alex Richert <82525672+AlexanderRichert-NOAA@users.noreply.github.com> Date: Mon, 11 Dec 2023 02:15:01 -0800 Subject: [PATCH 16/21] fms: add v2023.04 (#41475) --- var/spack/repos/builtin/packages/fms/package.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/var/spack/repos/builtin/packages/fms/package.py b/var/spack/repos/builtin/packages/fms/package.py index 17b7aa4322ec1c..eddab2b866b7c6 100644 --- a/var/spack/repos/builtin/packages/fms/package.py +++ b/var/spack/repos/builtin/packages/fms/package.py @@ -17,12 +17,7 @@ class Fms(CMakePackage): git = "https://github.com/NOAA-GFDL/FMS.git" maintainers("AlexanderRichert-NOAA", "Hang-Lei-NOAA", "edwardhartnett", "rem1776", "climbfuji") - version("2023.04", sha256="feb895ea2b3269ca66df296199a36af335f0dc281e2dab2f1bfebb19fd9c22c4") - version("2023.03", sha256="008a9ff394efe6a8adbcf37dd45ca103e00ae25748fc2960b7bc54f2f3b08d85") - version( - "2023.02.01", sha256="1597f7a485d02e401ce76444b2401060d74bd032cbb060cef917f001b4ff14bc" - ) version("2023.02", sha256="dc029ffadfd82c334f104268bedd8635c77976485f202f0966ae4cf06d2374be") version( "2023.01.01", sha256="f83e2814a1e3ba439ab847ec8bb251f3889d5ca14fb20849507590adbbe8e899" From bd372d2f82b1942e5714c6c0c8c53405d047f4d0 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 11 Dec 2023 11:18:05 -0700 Subject: [PATCH 17/21] Add @climbfuji to fms maintainers (#41550) --- var/spack/repos/builtin/packages/fms/package.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/var/spack/repos/builtin/packages/fms/package.py b/var/spack/repos/builtin/packages/fms/package.py index eddab2b866b7c6..17b7aa4322ec1c 100644 --- a/var/spack/repos/builtin/packages/fms/package.py +++ b/var/spack/repos/builtin/packages/fms/package.py @@ -17,7 +17,12 @@ class Fms(CMakePackage): git = "https://github.com/NOAA-GFDL/FMS.git" maintainers("AlexanderRichert-NOAA", "Hang-Lei-NOAA", "edwardhartnett", "rem1776", "climbfuji") + version("2023.04", sha256="feb895ea2b3269ca66df296199a36af335f0dc281e2dab2f1bfebb19fd9c22c4") + version("2023.03", sha256="008a9ff394efe6a8adbcf37dd45ca103e00ae25748fc2960b7bc54f2f3b08d85") + version( + "2023.02.01", sha256="1597f7a485d02e401ce76444b2401060d74bd032cbb060cef917f001b4ff14bc" + ) version("2023.02", sha256="dc029ffadfd82c334f104268bedd8635c77976485f202f0966ae4cf06d2374be") version( "2023.01.01", sha256="f83e2814a1e3ba439ab847ec8bb251f3889d5ca14fb20849507590adbbe8e899" From 9e24e59a4eec2d0cf64c49c4c8d8a8cbe3bb3b7d Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 11 Dec 2023 16:31:52 -0700 Subject: [PATCH 18/21] Skip 'icc.patch' in var/spack/repos/builtin/packages/py-gevent/package.py for py-gevent@23.7.0+ --- var/spack/repos/builtin/packages/py-gevent/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/py-gevent/package.py b/var/spack/repos/builtin/packages/py-gevent/package.py index c41b815ef24320..7216c0c6d6dde2 100644 --- a/var/spack/repos/builtin/packages/py-gevent/package.py +++ b/var/spack/repos/builtin/packages/py-gevent/package.py @@ -39,7 +39,7 @@ class PyGevent(PythonPackage): conflicts("^py-cython@3:", when="@:20.5.0") # Deprecated compiler options. upstream PR: https://github.com/gevent/gevent/pull/1896 - patch("icc.patch", when="%intel") + patch("icc.patch", when="@:21.12.0 %intel") @run_before("install") def recythonize(self): From b0baa0ad356a7168fd74cf9020375079e56179d6 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 11 Dec 2023 19:43:14 -0700 Subject: [PATCH 19/21] Proceed without MPI or Python modules if not in environment --- lib/jcsda-emc/spack-stack/stack/meta_modules.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/lib/jcsda-emc/spack-stack/stack/meta_modules.py b/lib/jcsda-emc/spack-stack/stack/meta_modules.py index f662c1f9f87d8e..b6e18f30cb198a 100755 --- a/lib/jcsda-emc/spack-stack/stack/meta_modules.py +++ b/lib/jcsda-emc/spack-stack/stack/meta_modules.py @@ -304,11 +304,7 @@ def setup_meta_modules(): # Then, check for mpi providers - recursively for compilers mpi_dict = get_matched_dict(module_dir, mpi_candidate_list, compiler_candidate_list) if not mpi_dict: - user_input = input( - "No matching MPI providers found, proceed without creating MPI module hierarchy? (yes/no): " - ) - if not user_input.lower() in ["yes", "y"]: - raise Exception("No matching MPI providers found") + logging.warn("No matching MPI providers found, skipping MPI module hierarchy") else: logging.info(" ... stack mpi providers: '{}'".format(mpi_dict)) @@ -721,15 +717,8 @@ def setup_meta_modules(): not compiler_name in python_dict.keys() or not compiler_version in python_dict[compiler_name].keys() ): - user_input = input( - f"No Python version found for compiler {compiler_name}@{compiler_version}, proceed without creating Python modules? (yes/no): " - ) - if not user_input.lower() in ["yes", "y"]: - raise Exception( - f"No Python version found for compiler {compiler_name}@{compiler_version}." - ) - else: - continue + logging.warn("No Python version found for compiler {compiler_name}@{compiler_version}, skipping Python modules") + continue spec = python_dict[compiler_name][compiler_version] python_version = str(spec.version) logging.info( From e256fe22ad1aa0a4ec49b0b82669f23e8e07f31e Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 11 Dec 2023 20:48:09 -0700 Subject: [PATCH 20/21] Fix formatting errors in lib/jcsda-emc/spack-stack/stack/meta_modules.py --- black.patch | 17 +++++++++++++++++ lib/jcsda-emc/spack-stack/stack/meta_modules.py | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 black.patch diff --git a/black.patch b/black.patch new file mode 100644 index 00000000000000..41b8bdfe5a6c59 --- /dev/null +++ b/black.patch @@ -0,0 +1,17 @@ +--- lib/jcsda-emc/spack-stack/stack/meta_modules.py 2023-12-12 02:44:14.068945+00:00 ++++ lib/jcsda-emc/spack-stack/stack/meta_modules.py 2023-12-12 02:44:27.720853+00:00 +@@ -715,11 +715,13 @@ + for compiler_version in compiler_dict[compiler_name]: + if ( + not compiler_name in python_dict.keys() + or not compiler_version in python_dict[compiler_name].keys() + ): +- logging.warn("No Python version found for compiler {compiler_name}@{compiler_version}, skipping Python modules") ++ logging.warn( ++ "No Python version found for compiler {compiler_name}@{compiler_version}, skipping Python modules" ++ ) + continue + spec = python_dict[compiler_name][compiler_version] + python_version = str(spec.version) + logging.info( + " ... configuring stack python interpreter {}@{} for compiler {}@{}".format( diff --git a/lib/jcsda-emc/spack-stack/stack/meta_modules.py b/lib/jcsda-emc/spack-stack/stack/meta_modules.py index b6e18f30cb198a..6a8061e8193588 100755 --- a/lib/jcsda-emc/spack-stack/stack/meta_modules.py +++ b/lib/jcsda-emc/spack-stack/stack/meta_modules.py @@ -717,7 +717,9 @@ def setup_meta_modules(): not compiler_name in python_dict.keys() or not compiler_version in python_dict[compiler_name].keys() ): - logging.warn("No Python version found for compiler {compiler_name}@{compiler_version}, skipping Python modules") + logging.warn( + "No Python version found for compiler {compiler_name}@{compiler_version}, skipping Python modules" + ) continue spec = python_dict[compiler_name][compiler_version] python_version = str(spec.version) From aa011fc3279dee2e89266d148798bb871f4c1d7f Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 12 Dec 2023 09:21:22 -0700 Subject: [PATCH 21/21] Remove black.patch --- black.patch | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 black.patch diff --git a/black.patch b/black.patch deleted file mode 100644 index 41b8bdfe5a6c59..00000000000000 --- a/black.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- lib/jcsda-emc/spack-stack/stack/meta_modules.py 2023-12-12 02:44:14.068945+00:00 -+++ lib/jcsda-emc/spack-stack/stack/meta_modules.py 2023-12-12 02:44:27.720853+00:00 -@@ -715,11 +715,13 @@ - for compiler_version in compiler_dict[compiler_name]: - if ( - not compiler_name in python_dict.keys() - or not compiler_version in python_dict[compiler_name].keys() - ): -- logging.warn("No Python version found for compiler {compiler_name}@{compiler_version}, skipping Python modules") -+ logging.warn( -+ "No Python version found for compiler {compiler_name}@{compiler_version}, skipping Python modules" -+ ) - continue - spec = python_dict[compiler_name][compiler_version] - python_version = str(spec.version) - logging.info( - " ... configuring stack python interpreter {}@{} for compiler {}@{}".format(