File tree Expand file tree Collapse file tree 4 files changed +9
-1
lines changed Expand file tree Collapse file tree 4 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ requirements:
2222 - importlib_resources
2323 - jinja2
2424 - lxml
25+ - packaging
2526 - pyyaml
2627 - requests
2728 - rsync
Original file line number Diff line number Diff line change 33from importlib import resources as importlib_resources
44
55from jinja2 import Template
6+ from packaging .version import Version
67
78from mache .machine_info import MachineInfo , discover_machine
89from mache .spack .script import get_spack_script
@@ -139,9 +140,13 @@ def make_spack_env(
139140
140141 modules = f'{ modules } \n export TMPDIR={ tmpdir } '
141142
143+ # Use PEP 440 parsing to strip any pre/dev/post release tags and keep only
144+ # the base release version (e.g., "1.2.3rc1" -> "1.2.3").
145+ version = Version (__version__ ).base_version
146+
142147 template_args = dict (
143148 modules = modules ,
144- version = __version__ ,
149+ version = version ,
145150 spack_path = spack_path ,
146151 env_name = env_name ,
147152 yaml_filename = yaml_filename ,
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ dependencies = [
2424 " importlib_resources" ,
2525 " jinja2" ,
2626 " lxml" ,
27+ " packaging" ,
2728 " pyyaml" ,
2829 " requests" ,
2930 " termcolor" ,
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ python >=3.9
22importlib_resources
33jinja2
44lxml
5+ packaging
56pyyaml
67requests
78rsync
You can’t perform that action at this time.
0 commit comments