Skip to content

Commit

Permalink
update git-fleximod to 0.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
peverwhee committed Nov 20, 2024
1 parent 51d1e07 commit a9441a8
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 32 deletions.
38 changes: 21 additions & 17 deletions .lib/git-fleximod/git_fleximod/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,31 @@
import argparse
from git_fleximod import utils

__version__ = "0.9.2"
__version__ = "0.9.3"

def find_root_dir(filename=".gitmodules"):
""" finds the highest directory in tree
which contains a file called filename """
d = Path.cwd()
root = Path(d.root)
dirlist = []
dl = d
while dl != root:
dirlist.append(dl)
dl = dl.parent
dirlist.append(root)
dirlist.reverse()

for dl in dirlist:
attempt = dl / filename
if attempt.is_file():
return str(dl)
return None

try:
root = utils.execute_subprocess(["git","rev-parse", "--show-toplevel"],
output_to_caller=True ).rstrip()
except:
d = Path.cwd()
root = Path(d.root)
dirlist = []
dl = d
while dl != root:
dirlist.append(dl)
dl = dl.parent
dirlist.append(root)
dirlist.reverse()

for dl in dirlist:
attempt = dl / filename
if attempt.is_file():
return str(dl)
return None
return Path(root)

def get_parser():
description = """
Expand Down
2 changes: 1 addition & 1 deletion .lib/git-fleximod/git_fleximod/git_fleximod.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def main():
excludelist=excludelist,
)
if not gitmodules.sections():
sys.exit("No submodule components found")
sys.exit(f"No submodule components found, root_dir={root_dir}")
retval = 0
if action == "update":
submodules_update(gitmodules, root_dir, fxrequired, force)
Expand Down
2 changes: 1 addition & 1 deletion .lib/git-fleximod/git_fleximod/submodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def sparse_checkout(self):
if superroot:
gitroot = superroot.strip()
else:
gitroot = self.root_dir.strip()
gitroot = self.root_dir
# Now need to move the .git dir to the submodule location
rootdotgit = os.path.join(self.root_dir, ".git")
while os.path.isfile(rootdotgit):
Expand Down
6 changes: 3 additions & 3 deletions .lib/git-fleximod/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .lib/git-fleximod/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "git-fleximod"
version = "0.9.2"
version = "0.9.3"
description = "Extended support for git-submodule and git-sparse-checkout"
authors = ["Jim Edwards <jedwards@ucar.edu>"]
maintainers = ["Jim Edwards <jedwards@ucar.edu>"]
Expand Down
2 changes: 1 addition & 1 deletion .lib/git-fleximod/tbump.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
github_url = "https://github.com/jedwards4b/git-fleximod/"

[version]
current = "0.9.2"
current = "0.9.3"

# Example of a semver regexp.
# Make sure this matches current_version before
Expand Down
4 changes: 2 additions & 2 deletions .lib/git-fleximod/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def logger():
"submodule_name": "test_optional",
"status1" : "test_optional MPIserial_2.5.0-3-gd82ce7c is out of sync with .gitmodules MPIserial_2.4.0",
"status2" : "test_optional at tag MPIserial_2.4.0",
"status3" : "test_optional not checked out, out of sync at tag None, expected tag is MPIserial_2.4.0 (optional)",
"status3" : "test_optional not checked out, out of sync at tag MPIserial_2.5.1, expected tag is MPIserial_2.4.0 (optional)",
"status4" : "test_optional at tag MPIserial_2.4.0",
"gitmodules_content": """
[submodule "test_optional"]
Expand All @@ -46,7 +46,7 @@ def logger():
"submodule_name": "test_alwaysoptional",
"status1" : "test_alwaysoptional MPIserial_2.3.0 is out of sync with .gitmodules e5cf35c",
"status2" : "test_alwaysoptional at hash e5cf35c",
"status3" : "out of sync at tag None, expected tag is e5cf35c",
"status3" : "out of sync at tag MPIserial_2.5.1, expected tag is e5cf35c",
"status4" : "test_alwaysoptional at hash e5cf35c",
"gitmodules_content": """
[submodule "test_alwaysoptional"]
Expand Down
10 changes: 7 additions & 3 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
===============================================================

Tag name: cam6_4_047
Tag name: cam6_4_049
Originator(s): peverwhee
Date: 12 November 2024
Date: November 2024
One-line Summary: History bugfixes
Github PR URL: https://github.com/ESCOMP/CAM/pull/1163

Expand All @@ -12,7 +12,8 @@ Purpose of changes (include the issue number and title text for each relevant Gi
- Issue #1166: time_bounds array should not be present in history files containing instantaneous output
- Issue #1167: Time shown in history file names is incorrect for instantaneous data
- Issue #1183: Suggested improvement for openfile
- Updates git-fleximod to v0.9.2
- Update git-fleximod to v0.9.3
- Update archive_baseline.sh modify read permissions on izumi

Describe any changes made to build system:
M bld/namelist_files/use_cases/sd_waccm_sulfur.xml
Expand Down Expand Up @@ -66,6 +67,9 @@ M src/physics/cam7/stochastic_tau_cam.F90
M src/utils/cam_pio_utils.F90
- move filename logging to before pio call

M test/system/archive_baseline.sh
- make all baseline files globally readable on izumi

If there were any failures reported from running test_driver.sh on any test
platform, and checkin with these failures has been OK'd by the gatekeeper,
then copy the lines from the td.*.status files for the failed tests to the
Expand Down
4 changes: 1 addition & 3 deletions test/system/archive_baseline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ case $hostname in
test_file_list="tests_pretag_izumi_${CAM_FC,,}"
cam_tag=$1_${CAM_FC,,}
baselinedir="/fs/cgd/csm/models/atm/cam/pretag_bl/$cam_tag"
chmod_cmd="chmod -R a+r ${baselinedir}"
;;

de*)
Expand All @@ -79,7 +78,6 @@ case $hostname in
test_file_list="tests_pretag_derecho_${CAM_FC,,}"
cam_tag=$1_${CAM_FC,,}
baselinedir="/glade/campaign/cesm/community/amwg/cam_baselines/$cam_tag"
chmod_cmd=""
;;

* ) echo "ERROR: machine $hostname not currently supported"; exit 1 ;;
Expand All @@ -99,7 +97,7 @@ if [ -n "$CESM_TESTDIR" ]; then
if [ -d $CESM_TESTDIR/baselines ]; then
echo "Using cp to archive baselines."
cp -r $CESM_TESTDIR/baselines/. $root_baselinedir/$cam_tag
eval ${chmod_cmd}
chmod -R a+r ${baselinedir}
else
echo "Using bless_test_results to archive baselines."
../../cime/CIME/Tools/bless_test_results -p -t '' -c '' -r $CESM_TESTDIR --baseline-root $root_baselinedir -b $cam_tag -f -s
Expand Down

0 comments on commit a9441a8

Please sign in to comment.