diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index cb67b70..813f89c 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -10,9 +10,14 @@ on: jobs: build-images: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 + - run: python3 -m venv build_images_venv + - name: Activate virtualenv + run: | + . build_images_venv/bin/activate + echo PATH=$PATH >> $GITHUB_ENV - run: python3 -mpip install -r requirements.txt - run: git clone --depth=1 https://github.com/adafruit/Adafruit_Learning_System_Guides learn - run: env LEARN_GUIDE_REPO=learn/ python3 create_requirement_images.py diff --git a/create_requirement_images.py b/create_requirement_images.py index 90d8762..1f59017 100755 --- a/create_requirement_images.py +++ b/create_requirement_images.py @@ -395,6 +395,29 @@ def make_sd_dir(position): triangle_icon=right_triangle, ) + def filter_custom_project_libs(project_file_set): + """ + Find and remove the custom project lib folder. + Returns a tuple with the contents of the custom project lib folder + which will in turn get included in the libraries list that the + tool uses to generate the "main" lib folder in the screenshot. + """ + _custom_libs = tuple() + remove_files = [] + for file in project_file_set: + if not isinstance(file, tuple): + continue + if file[0] == "lib": + _custom_libs = file[1] + remove_files.append(file) + for file in remove_files: + project_file_set.remove(file) + return _custom_libs + + custom_libs = filter_custom_project_libs(project_files) + libs_list = list(libs) + libs_list.extend(custom_libs) + libs = set(libs_list) final_list_to_render = sort_libraries(libs) if settings_required(final_list_to_render): context["added_settings_toml"] = True