Skip to content

Commit 1409349

Browse files
committed
Merge remote-tracking branch 'ESCOMP/cam_development' into rrtmgp-sw
2 parents d54a9b1 + 280dbbd commit 1409349

File tree

20 files changed

+233
-61
lines changed

20 files changed

+233
-61
lines changed

.github/workflows/fleximod_test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
uses: actions/checkout@v4
1414
- id: run-fleximod
1515
run: |
16-
$GITHUB_WORKSPACE/bin/git-fleximod update
16+
$GITHUB_WORKSPACE/bin/git-fleximod update -o
1717
echo
1818
echo "Update complete, checking status"
1919
echo
@@ -23,7 +23,7 @@ jobs:
2323
echo
2424
echo "Checking if git fleximod matches expected externals"
2525
echo
26-
git diff --exit-code
26+
git add . && git diff --exit-code && git diff --cached --exit-code
2727
# - name: Setup tmate session
2828
# if: ${{ failure() }}
2929
# uses: mxschmitt/action-tmate@v3

.gitmodules

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,56 +110,56 @@
110110
[submodule "cism"]
111111
path = components/cism
112112
url = https://github.com/ESCOMP/CISM-wrapper
113-
fxtag = cismwrap_2_2_006
113+
fxtag = cismwrap_2_2_010
114114
fxrequired = ToplevelRequired
115115
fxDONOTUSEurl = https://github.com/ESCOMP/CISM-wrapper
116116

117117
[submodule "rtm"]
118118
path = components/rtm
119119
url = https://github.com/ESCOMP/RTM
120-
fxtag = rtm1_0_86
120+
fxtag = rtm1_0_89
121121
fxrequired = ToplevelRequired
122122
fxDONOTUSEurl = https://github.com/ESCOMP/RTM
123123

124124
[submodule "mosart"]
125125
path = components/mosart
126126
url = https://github.com/ESCOMP/MOSART
127-
fxtag = mosart1.1.08
127+
fxtag = mosart1.1.12
128128
fxrequired = ToplevelRequired
129129
fxDONOTUSEurl = https://github.com/ESCOMP/MOSART
130130

131131
[submodule "mizuRoute"]
132132
path = components/mizuRoute
133133
url = https://github.com/ESCOMP/mizuRoute
134-
fxtag = cesm-coupling.n03_v2.2.0
134+
fxtag = v3.0.0
135135
fxrequired = ToplevelRequired
136136
fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute
137137

138138
[submodule "ccs_config"]
139139
path = ccs_config
140140
url = https://github.com/ESMCI/ccs_config_cesm.git
141-
fxtag = ccs_config_cesm1.0.53
141+
fxtag = ccs_config_cesm1.0.61
142142
fxrequired = ToplevelRequired
143143
fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git
144144

145145
[submodule "cime"]
146146
path = cime
147147
url = https://github.com/ESMCI/cime
148-
fxtag = cime6.1.102
148+
fxtag = cime6.1.126
149149
fxrequired = ToplevelRequired
150150
fxDONOTUSEurl = https://github.com/ESMCI/cime
151151

152152
[submodule "cmeps"]
153153
path = components/cmeps
154154
url = https://github.com/ESCOMP/CMEPS.git
155-
fxtag = cmeps1.0.47
155+
fxtag = cmeps1.1.16
156156
fxrequired = ToplevelRequired
157157
fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git
158158

159159
[submodule "cdeps"]
160160
path = components/cdeps
161161
url = https://github.com/ESCOMP/CDEPS.git
162-
fxtag = cdeps1.0.73
162+
fxtag = cdeps1.0.80
163163
fxrequired = ToplevelRequired
164164
fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git
165165

@@ -173,7 +173,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CESM_share
173173
[submodule "parallelio"]
174174
path = libraries/parallelio
175175
url = https://github.com/NCAR/ParallelIO
176-
fxtag = pio2_6_4
176+
fxtag = pio2_6_6
177177
fxrequired = ToplevelRequired
178178
fxDONOTUSEurl = https://github.com/NCAR/ParallelIO
179179

@@ -187,7 +187,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CESM_CICE
187187
[submodule "clm"]
188188
path = components/clm
189189
url = https://github.com/ESCOMP/CTSM
190-
fxtag = ctsm5.3.029
190+
fxtag = alpha-ctsm5.4.CMIP7.09.ctsm5.3.068
191191
fxrequired = ToplevelRequired
192192
fxDONOTUSEurl = https://github.com/ESCOMP/CTSM
193193

@@ -201,7 +201,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/FMS_interface
201201
[submodule "tools/CUPiD"]
202202
path = tools/CUPiD
203203
url = https://github.com/NCAR/CUPiD.git
204-
fxtag = v0.2.1
204+
fxtag = v0.3.1
205205
fxrequired = ToplevelRequired
206206
fxDONOTUSEurl = https://github.com/NCAR/CUPiD.git
207207

.lib/git_fleximod/cli.py

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
from pathlib import Path
22
import argparse, os, sys
3-
from importlib.resources import files
43
from git_fleximod import utils
54

6-
__version__ = "1.0.1"
5+
__version__ = "1.0.2"
76

87
class CustomArgumentParser(argparse.ArgumentParser):
98
def print_help(self, file=None):
@@ -12,8 +11,8 @@ def print_help(self, file=None):
1211

1312
# Then append the contents of README.md
1413
candidate_paths = [
15-
os.path.join(sys.prefix, "share", "your-package", "README.md"),
16-
os.path.join(os.path.dirname(__file__), "..", "README.md") # fallback for dev
14+
Path(sys.prefix) / "share" / "git_fleximod" / "README.md",
15+
Path(__file__).resolve().parent.parent / "README.md", # fallback for dev
1716
]
1817
for path in candidate_paths:
1918
if os.path.exists(path):
@@ -25,26 +24,21 @@ def print_help(self, file=None):
2524
def find_root_dir(filename=".gitmodules"):
2625
""" finds the highest directory in tree
2726
which contains a file called filename """
28-
try:
29-
root = utils.execute_subprocess(["git","rev-parse", "--show-toplevel"],
30-
output_to_caller=True ).rstrip()
31-
except:
32-
d = Path.cwd()
33-
root = Path(d.root)
34-
dirlist = []
35-
dl = d
36-
while dl != root:
37-
dirlist.append(dl)
38-
dl = dl.parent
39-
dirlist.append(root)
40-
dirlist.reverse()
41-
42-
for dl in dirlist:
43-
attempt = dl / filename
44-
if attempt.is_file():
45-
return str(dl)
46-
return None
47-
return Path(root)
27+
d = Path.cwd()
28+
root = Path(d.root)
29+
dirlist = []
30+
dl = d
31+
while dl != root:
32+
dirlist.append(dl)
33+
dl = dl.parent
34+
dirlist.append(root)
35+
dirlist.reverse()
36+
37+
for dl in dirlist:
38+
attempt = dl / filename
39+
if attempt.is_file():
40+
return str(dl)
41+
return None
4842

4943
def get_parser():
5044
description = """

.lib/git_fleximod/gitinterface.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,14 @@ def _git_operation_command(self, operation, args):
6060

6161
# pylint: disable=unused-argument
6262
def git_operation(self, operation, *args, **kwargs):
63-
command = self._git_operation_command(operation, args)
63+
newargs = []
64+
for a in args:
65+
# Do not use ssh interface
66+
if isinstance(a, str):
67+
a = a.replace("[email protected]:", "https://github.com/")
68+
newargs.append(a)
69+
70+
command = self._git_command(operation, *newargs)
6471
if isinstance(command, list):
6572
try:
6673
status, output = utils.execute_subprocess(command, status_to_caller=True, output_to_caller=True)

.lib/git_fleximod/submodule.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,27 +119,25 @@ def status(self):
119119
atag = atag[:-1]
120120
if atag == self.fxtag:
121121
break
122-
123-
124-
#print(f"line is {line} ahash is {ahash} atag is {atag} {parts}")
125-
# atag = git.git_operation("describe", "--tags", "--always")
126-
# ahash = git.git_operation("rev-list", "HEAD").partition("\n")[0]
127-
128122
recurse = False
129123
if rurl != self.url:
130124
remote = self._add_remote(git)
131125
git.git_operation("fetch", remote)
126+
# Asked for a tag and found that tag
132127
if self.fxtag and atag == self.fxtag:
133128
result = f" {self.name:>20} at tag {self.fxtag}"
134129
recurse = True
135130
testfails = False
131+
# Asked for and found a hash
136132
elif self.fxtag and (ahash[: len(self.fxtag)] == self.fxtag or (self.fxtag.find(ahash)==0)):
137133
result = f" {self.name:>20} at hash {ahash}"
138134
recurse = True
139135
testfails = False
136+
# Asked for and found a hash
140137
elif atag == ahash:
141138
result = f" {self.name:>20} at hash {ahash}"
142139
recurse = True
140+
# Did not find requested tag or hash
143141
elif self.fxtag:
144142
result = f"s {self.name:>20} {atag} {ahash} is out of sync with .gitmodules {self.fxtag}"
145143
testfails = True
@@ -396,13 +394,19 @@ async def update(self):
396394
smgit = GitInterface(repodir, self.logger)
397395
newremote = self._add_remote(smgit)
398396
# Trying to distingush a tag from a hash
399-
allowed = set(string.digits + 'abcdef')
397+
allowed = set(string.digits + 'abcdef')
398+
status = 0
400399
if not set(self.fxtag) <= allowed:
401400
# This is a tag
402401
tag = f"refs/tags/{self.fxtag}:refs/tags/{self.fxtag}"
403-
smgit.git_operation("fetch", newremote, tag)
404-
smgit.git_operation("checkout", self.fxtag)
405-
402+
status,_ = smgit.git_operation("fetch", newremote, tag)
403+
if status == 0:
404+
status,_ = smgit.git_operation("checkout", self.fxtag)
405+
if status:
406+
utils.fatal_error(
407+
f"Failed to checkout {self.name} at tag or hash {self.fxtag} from {repodir}"
408+
)
409+
406410
if not os.path.exists(os.path.join(repodir, ".git")):
407411
utils.fatal_error(
408412
f"Failed to checkout {self.name} {repo_exists} {repodir} {self.path}"

.lib/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "git-fleximod"
3-
version = "1.0.1"
3+
version = "1.0.2"
44
description = "Extended support for git-submodule and git-sparse-checkout"
55
authors = ["Jim Edwards <[email protected]>"]
66
maintainers = ["Jim Edwards <[email protected]>"]

.lib/tbump.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
github_url = "https://github.com/jedwards4b/git-fleximod/"
33

44
[version]
5-
current = "1.0.1"
5+
current = "1.0.2"
66

77
# Example of a semver regexp.
88
# Make sure this matches current_version before

.lib/tests/test_c_required.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
import re
23
from pathlib import Path
34

45
def test_required(git_fleximod, test_repo, shared_repos):
@@ -28,3 +29,15 @@ def test_required(git_fleximod, test_repo, shared_repos):
2829
assert result.returncode == 0
2930
status = git_fleximod(test_repo, f"status {repo_name}")
3031
assert shared_repos["status4"] in status.stdout
32+
33+
text = file_path.read_text()
34+
new_value = "somethingelse"
35+
pattern = r"(^\s*fxtag\s*=\s*).*$"
36+
replacement = r"\1" + new_value
37+
new_text = re.sub(pattern, replacement, text, flags=re.MULTILINE)
38+
39+
# Write updated content back to file
40+
file_path.write_text(new_text)
41+
42+
result = git_fleximod(test_repo, f"update {repo_name}")
43+
assert f'fatal: couldn\'t find remote ref' in result.stderr or 'error: pathspec \'somethingelse\' did not match any file(s) known to git' in result.stderr

cime

Submodule cime updated 150 files

0 commit comments

Comments
 (0)