-
-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically install dependencies of the local (private) libraries // …
…Resolve #2910
- Loading branch information
1 parent
fcb81ae
commit be8f842
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,6 +196,48 @@ def test_project(clirunner, validate_cliresult, isolated_pio_core, tmp_path): | |
assert "Already up-to-date" in result.output | ||
|
||
|
||
def test_private_lib_deps(clirunner, validate_cliresult, isolated_pio_core, tmp_path): | ||
project_dir = tmp_path / "project" | ||
private_lib_dir = project_dir / "lib" / "private" | ||
private_lib_dir.mkdir(parents=True) | ||
(private_lib_dir / "library.json").write_text( | ||
""" | ||
{ | ||
"name": "My Private Lib", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"bblanchon/ArduinoJson": "^6.19.2", | ||
"milesburton/DallasTemperature": "^3.9.1" | ||
} | ||
} | ||
""" | ||
) | ||
(project_dir / "platformio.ini").write_text( | ||
""" | ||
[env:private] | ||
platform = native | ||
""" | ||
) | ||
with fs.cd(str(project_dir)): | ||
result = clirunner.invoke(package_install_cmd) | ||
validate_cliresult(result) | ||
config = ProjectConfig() | ||
installed_lib_pkgs = LibraryPackageManager( | ||
os.path.join(config.get("platformio", "lib_dir")) | ||
).get_installed() | ||
assert pkgs_to_specs(installed_lib_pkgs) == [ | ||
PackageSpec("My Private [email protected]") | ||
] | ||
installed_libdeps_pkgs = LibraryPackageManager( | ||
os.path.join(config.get("platformio", "libdeps_dir"), "private") | ||
).get_installed() | ||
assert pkgs_to_specs(installed_libdeps_pkgs) == [ | ||
PackageSpec("[email protected]"), | ||
PackageSpec("[email protected]"), | ||
PackageSpec("[email protected]"), | ||
] | ||
|
||
|
||
def test_unknown_project_dependencies( | ||
clirunner, validate_cliresult, isolated_pio_core, tmp_path | ||
): | ||
|