Skip to content

Commit

Permalink
Merge pull request #66 from ESMCI/poetry_and_test_update
Browse files Browse the repository at this point in the history
update poetry certifi version and update tests failing due to mpi-ser…
  • Loading branch information
jedwards4b authored Nov 13, 2024
2 parents 02e8599 + 1357707 commit 1e0c40a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 23 deletions.
36 changes: 20 additions & 16 deletions git_fleximod/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,26 @@
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 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 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 poetry.lock

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

4 changes: 2 additions & 2 deletions 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

0 comments on commit 1e0c40a

Please sign in to comment.