Skip to content

Commit

Permalink
Merge pull request #116 from sot/fix-dashboard
Browse files Browse the repository at this point in the history
Fix dashboard
javierggt authored Aug 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 5cca052 + acf871e commit 9adfdbc
Showing 2 changed files with 20 additions and 12 deletions.
16 changes: 13 additions & 3 deletions skare3_tools/packages.py
Original file line number Diff line number Diff line change
@@ -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"],
16 changes: 7 additions & 9 deletions skare3_tools/test_results.py
Original file line number Diff line number Diff line change
@@ -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
@@ -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."
)

0 comments on commit 9adfdbc

Please sign in to comment.