Skip to content

Commit

Permalink
Require python 3.8 or higher (#596)
Browse files Browse the repository at this point in the history
* Require python 3.8 or higher

* Fix typo

* Try heavy machinery

* Update workflow
  • Loading branch information
psakievich authored Apr 2, 2024
1 parent 5d58a5a commit be8de9d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
spack-version: [0.21.0, develop]
python-version: [3.8, 3.9, 3.12]
spack-version: [0.21.2, develop]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -77,8 +77,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
spack-version: [0.21.0, develop]
python-version: [3.8, 3.9]
spack-version: [0.21.2, develop]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
21 changes: 21 additions & 0 deletions check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2022, National Technology & Engineering Solutions of Sandia,
# LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
#
# This software is released under the BSD 3-clause license. See LICENSE file
# for more details.

"""
a script to make sure minimum requirements for spack-manager
are met.
- [email protected] or higher
"""
import sys

def check_spack_manager_requirements():
if sys.version_info < (3,8):
raise ValueError("Spack-Manager requires Python 3.8 or higher.")

if __name__ == "__main__":
check_spack_manager_requirements()
15 changes: 13 additions & 2 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@
import llnl.util.tty as tty
import os
import spack.main
import importlib.util
import sys

spec = importlib.util.spec_from_file_location("check", os.path.join(os.path.dirname(sys.argv[0]), "check.py"))
check = importlib.util.module_from_spec(spec)
sys.modules["check"] = check
spec.loader.exec_module(check)

parser = argparse.ArgumentParser()
parser.add_argument("-s", "--scope", required=False, help="Spack scope to register spack-manager")
parser.add_argument("--test", action='store_true', help="Don't actually install but test installation process")

if __name__ == "__main__":
args = parser.parse_args()
check.check_spack_manager_requirements()

extension_path = os.path.realpath(os.getcwd())
if not os.path.isdir(os.path.join(extension_path, "manager")):
Expand All @@ -34,5 +42,8 @@

register_args.extend(["add", "config:extensions:[{0}]".format(extension_path)])

config = spack.main.SpackCommand("config")
config(*register_args)
if args.test:
print("TEST:: config", *register_args)
else:
config = spack.main.SpackCommand("config")
config(*register_args)

0 comments on commit be8de9d

Please sign in to comment.