Automatic Library Installation from depends field in library.properties#205
Open
aliphys wants to merge 25 commits into
Open
Automatic Library Installation from depends field in library.properties#205aliphys wants to merge 25 commits into
depends field in library.properties#205aliphys wants to merge 25 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #205 +/- ##
==========================================
- Coverage 99.81% 99.75% -0.06%
==========================================
Files 2 2
Lines 1608 1665 +57
==========================================
+ Hits 1605 1661 +56
- Misses 3 4 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Author
|
@per1234 Can you approve this PR? |
per1234
requested changes
Dec 7, 2023
per1234
left a comment
Collaborator
There was a problem hiding this comment.
Please add unit test coverage for the added code.
Author
|
Author
|
There is an error in one workflow, which I don't think is related to this PR. |
3 tasks
2bndy5
reviewed
May 12, 2026
Comment on lines
+801
to
+803
| dependencies = self.get_library_dependencies(os.environ["GITHUB_REPOSITORY"]) | ||
| for depends_library in dependencies: | ||
| lib_install_command.extend(depends_library) |
Contributor
There was a problem hiding this comment.
Some issues with this:
GITHUB_REPOSITORYenv var does not point to a path, rather it only describes the project/repository in the formowner-name/repo-name. I think you were expecting something more likeGITHUB_WORKSPACE, but that assumes the repo is not checked out in a sub-path ofGITHUB_WORKSPACE.- This block is only triggered when installing a library from the lib manager (e.g.
- name: Adafruit BusIO). Installing a local lib's deps here doesn't really make sense. - You can drop the for loop here and just
lib_install_cmd.extend(dependencies)instead. If filtering deps is desirable then it would look like:Not sure how/if this passed python linters. Usefor dep in deps: if dep not in lib_install_cmd: lib_install_cmd.append(dep) # or as a one-liner lib_install_cmd.extend([dep for dep in deps if dep not in lib_install_cmd])
list.append()for a single item orlist.extend()to append multiple items from a iterable sequence.extend()-ing astrmay result in each char of the string becoming a separate item. - This block happens after
lib_install_cmdis already passed toself.run_arduino_cli_command()(see line just above this block). I highly doubt this proposal would have any behavioral impact (desirable or otherwise).
Note
FYI, I am adamantly against auto-installing the checked-out repo's deps without an explicit opt-in mechanism. See my rationality in #204 (comment)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses the limitation described by @per1234 in arduino-libraries/Arduino_UnifiedStorage#30 (review)
Currently, the compile-sketches action is unable to read dependancies from the
dependsfield. I have documented this issue in #204 .library.propertiesis included in the sketch directorydependskey usingre(limitation: only with ',' deliminator)install_libraries_from_library_manager()function to install identified libraries.ymlfile cc @sebromero