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

Fix dashboard #116

Merged
merged 3 commits into from
Aug 21, 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
16 changes: 13 additions & 3 deletions skare3_tools/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,19 @@ def _conda_package_list(update=True):
all_info = []
for f in all_meta:
macro = "{% macro compiler(arg) %}{% endmacro %}\n"
info = yaml.load(
jinja2.Template(macro + open(f).read()).render(), Loader=yaml.FullLoader
)
macro += "{% macro pin_compatible(arg) %}{% endmacro %}\n"
try:
info = yaml.load(
jinja2.Template(macro + open(f).read()).render(environ={}),
Loader=yaml.FullLoader,
)
except jinja2.TemplateError as err:
parent = os.path.split(os.path.split(f)[-2])[-1]
logging.getLogger("skare3").error(
f"Failed to parse recipe for {parent}: {err}"
)
continue

pkg_info = {
"name": os.path.basename(os.path.dirname(f)),
"package": info["package"]["name"],
Expand Down
16 changes: 7 additions & 9 deletions skare3_tools/test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,11 @@ def remove(uid=None, directory=None, uids=(), directories=()):
directories += [SKARE3_TEST_DATA / directory]

# make sure all directories are absolute and within the data tree
for directory in directories:
if SKARE3_TEST_DATA not in directory.resolve().parents:
LOGGER.warning(f"warning: {directory} not in SKARE3_DASH_DATA. Ignoring")
for direct in directories:
if SKARE3_TEST_DATA not in direct.resolve().parents:
LOGGER.warning(f"warning: {direct} not in SKARE3_DASH_DATA. Ignoring")
directories = [
directory
for directory in directories
if SKARE3_TEST_DATA in directory.resolve().parents
direct for direct in directories if SKARE3_TEST_DATA in direct.resolve().parents
]

# make a list of everything that will be removed
Expand All @@ -91,10 +89,10 @@ def remove(uid=None, directory=None, uids=(), directories=()):
test_result_index.remove(tr)
shutil.rmtree(SKARE3_TEST_DATA / tr["destination"])

for directory in directories:
if directory.exists():
for direct in directories:
if direct.exists():
LOGGER.warning(
f"The directory {directory} is still there."
f"The directory {direct} is still there."
"This does not happen unless the directory is already not in the index,"
"in which case it is safe to remove it by hand."
)
Expand Down