Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update get_git_repo_info to avoid KeyError exception #53

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dependency_manager/src/edm_tool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#
"""Everest Dependency Manager."""
from edm_tool import edm
__version__ = "0.6.2"

__version__ = "0.7.1"


def get_parser():
Expand Down
22 changes: 17 additions & 5 deletions dependency_manager/src/edm_tool/edm.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,22 @@ def get_git_repo_info(cls, repo_path: Path, fetch=False) -> dict:
"""
Return useful information about a repository a the given path.

TODO: return type should be a well defined object
Returns an empty dictionary if the path is no git repo
Returns a default dictionary if the path is no git repo
"""
repo_info = {'is_repo': False}
repo_info = {
'is_repo': False,
'fetch_worked': None,
'remote_branch': None,
'behind': None,
'ahead': None,
'tag': None,
'branch': None,
'dirty': None,
'detached': None,
'rev': None,
'short_rev': None,
'url': None,
}
if GitInfo.is_repo(repo_path):
repo_info["is_repo"] = True
if fetch:
Expand Down Expand Up @@ -1628,9 +1640,9 @@ def get_parser(version) -> argparse.ArgumentParser:
type=str,
action="append",
help="Bazel-style label for the build files into the deppendencies. " +
"The format should be `@<workspace>//<path>:BUILD.<dependency-name>.bazel`." +
"The format should be `@<workspace>//<path>:BUILD.<dependency-name>.bazel`." +
"<dependency-name> should correspond to the name of the dependency in " +
"the dependencies.yaml file. This option can be used multiple times." +
"the dependencies.yaml file. This option can be used multiple times." +
"If not provided, Bazel will search for BUILD file in the repo itself.",
required=False)

Expand Down
2 changes: 1 addition & 1 deletion dependency_manager/src/edm_tool/templates/cpm.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ endif()
{% endfor %}

execute_process(
COMMAND edm release --everest-core-dir ${PROJECT_SOURCE_DIR} --build-dir ${CMAKE_BINARY_DIR} --out ${CMAKE_BINARY_DIR}/release.json
COMMAND "${EVEREST_DEPENDENCY_MANAGER}" release --everest-core-dir ${PROJECT_SOURCE_DIR} --build-dir ${CMAKE_BINARY_DIR} --out ${CMAKE_BINARY_DIR}/release.json
)

install(
Expand Down