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

Automatic Library Installation from depends field in library.properties #205

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5334309
feat: Add lib dependencies from library.properties
aliphys Nov 18, 2023
0119c70
fix: add missing `:`
aliphys Nov 18, 2023
aad9e23
chore: use " instead of '
aliphys Nov 18, 2023
05f82d8
docs: correct dependencies spelling
aliphys Nov 18, 2023
cb8bb24
fix: add `self` to access shared attributes
aliphys Nov 18, 2023
dea4a23
style: dependsLibrary -> depends_library
aliphys Nov 18, 2023
8e9414e
fix: correct definition with `self`
aliphys Nov 18, 2023
1820c94
style: change `'` to `"`
aliphys Nov 18, 2023
1a8131d
fix: use os.environ["GITHUB_REPOSITORY"]
aliphys Nov 18, 2023
e28d54a
Merge branch 'main' into addLibrary
aliphys Dec 6, 2023
6bddc58
Merge branch 'main' into addLibrary
aliphys Jan 30, 2024
2082a83
Merge branch 'main' into addLibrary
aliphys Feb 1, 2024
3234550
Merge branch 'arduino:main' into addLibrary
aliphys Feb 6, 2024
291340c
Add tests for `get_dependancies_from_properties_file`
aliphys Feb 6, 2024
9266584
check director exists
aliphys Feb 6, 2024
2fb2193
Add os.getcwd()
aliphys Feb 6, 2024
647369d
Add os.getcwd() for all three mock locations
aliphys Feb 6, 2024
8e02abc
Fix mock assert for get_dependencies_from_properties_file
aliphys Feb 6, 2024
dc0e8ee
Add tests for `get_library_dependencies`
aliphys Feb 6, 2024
6ed3f23
Cleanup library.properties from previous test
aliphys Feb 6, 2024
9f6cf87
Add blank lines for linter
aliphys Feb 6, 2024
5275f33
Add blank lines
aliphys Feb 6, 2024
1fe58de
Merge branch 'main' into addLibrary
aliphys Feb 13, 2024
1ec0bae
Merge branch 'main' into addLibrary
aliphys Feb 17, 2024
5fa7818
Merge branch 'main' into addLibrary
aliphys Mar 6, 2024
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
Prev Previous commit
Next Next commit
check director exists
aliphys committed Feb 6, 2024
commit 9266584fe96b663d2becc22c1426d65d0b08593b
4 changes: 3 additions & 1 deletion compilesketches/tests/test_compilesketches.py
Original file line number Diff line number Diff line change
@@ -3184,8 +3184,10 @@
assert compilesketches.get_head_commit_hash() == expected_hash

# Automated library parsing from the library.properties file
def test_get_dependencies_from_properties_file_with_dependencies():

Check failure on line 3187 in compilesketches/tests/test_compilesketches.py

GitHub Actions / lint

expected 2 blank lines, found 1
properties_file = os.path.join(os.environ["GITHUB_WORKSPACE"], "library.properties")
directory = os.environ["GITHUB_WORKSPACE"]
os.makedirs(directory, exist_ok=True) # check directory exists
properties_file = os.path.join(directory, "library.properties")
with open(properties_file, "w") as file:
file.write("depends=Library1,Library2,Library3")

@@ -3195,9 +3197,9 @@
assert dependencies == ["Library1", "Library2", "Library3"]

# Empty library.properties file should not return any dependencies
def test_get_dependencies_from_properties_file_without_dependencies():

Check failure on line 3200 in compilesketches/tests/test_compilesketches.py

GitHub Actions / lint

expected 2 blank lines, found 1
properties_file = os.path.join(os.environ["GITHUB_WORKSPACE"], "library.properties")
with open(properties_file, "w") as file:

Check failure on line 3202 in compilesketches/tests/test_compilesketches.py

GitHub Actions / test

FileNotFoundError
file.write("depends=")

compilesketches_object = get_compilesketches_object()
@@ -3206,11 +3208,11 @@
assert dependencies == []

# No depends key inside library.properties, should not return any dependencies
def test_get_dependencies_from_properties_file_no_depends_key():

Check failure on line 3211 in compilesketches/tests/test_compilesketches.py

GitHub Actions / lint

expected 2 blank lines, found 1
properties_file = os.path.join(os.environ["GITHUB_WORKSPACE"], "library.properties")
with open(properties_file, "w") as file:

Check failure on line 3213 in compilesketches/tests/test_compilesketches.py

GitHub Actions / test

FileNotFoundError
file.write("key=value")

compilesketches_object = get_compilesketches_object()
dependencies = compilesketches_object.get_dependencies_from_properties_file(properties_file)