Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
11 changes: 11 additions & 0 deletions .github/workflows/regress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,17 @@ jobs:
uses: ./.github/actions/singularity-setup
- name: Run cpp unit tests
run: ./do gen:ext_pdf EXT=Xqci CFG=qc_iu.yaml VERSION=latest
regress-profile-extensions:
runs-on: ubuntu-latest
env:
SINGULARITY: 1
steps:
- name: Clone Github Repo Action
uses: actions/checkout@v4
- name: singularity setup
uses: ./.github/actions/singularity-setup
- name: Check profile-extensions
run: ./do test:profile_extensions
call-deploy:
uses: ./.github/workflows/deploy.yml
with:
Expand Down
5 changes: 5 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ Dir.glob("#{$root}/tools/ruby-gems/*/Rakefile") do |rakefile|
load rakefile
end

# Load and execute tools Rakefiles
Dir.glob("#{$root}/tools/*/tasks.rake") do |rakefile|
load rakefile
end

directory "#{$root}/.stamps"

file "#{$root}/.stamps/dev_gems" => ["#{$root}/.stamps"] do |t|
Expand Down
32 changes: 32 additions & 0 deletions tools/python/UDB.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python3
# Copyright (c) Ventana Micro Systems
# SPDX-License-Identifier: BSD-3-Clause-Clear

import yaml
from pathlib import Path


def store_yaml(path, kinds=[]):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should avoid using an empty list as a default argument. It can create some very strange results if a function is called multiple times. See https://docs.astral.sh/ruff/rules/mutable-argument-default/ for more details.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I learned something today.

Fixed.

database = []
with open(path) as f:
y = yaml.safe_load(f)
if "kind" in y:
if len(kinds) == 0 or y["kind"] in kinds:
y["file"] = path
database.append(y)
return database


database = []


def find_and_load_yaml(path, kinds=[]):
global database
p = Path(path)
if p.is_dir():
for dirent in p.iterdir():
find_and_load_yaml(dirent, kinds)
else:
if str(path).endswith(".yaml"):
database += store_yaml(path, kinds)
return database
Loading
Loading