mirror of
https://github.com/platformio/platformio-core.git
synced 2025-08-01 02:54:25 +02:00
Fixed an issue with "Invalid simple block (semantic_version)" from library dependency that refs to an external source (repository, ZIP/Tar archives) // Resolve #3658
This commit is contained in:
@@ -17,6 +17,7 @@ PlatformIO Core 5
|
|||||||
- Fixed an issue when `pio package unpublish <https://docs.platformio.org/page/core/userguide/package/cmd_unpublish.html>`__ command crashes (`issue #3660 <https://github.com/platformio/platformio-core/issues/3660>`_)
|
- Fixed an issue when `pio package unpublish <https://docs.platformio.org/page/core/userguide/package/cmd_unpublish.html>`__ command crashes (`issue #3660 <https://github.com/platformio/platformio-core/issues/3660>`_)
|
||||||
- Fixed an issue when the package manager tries to install a built-in library from the registry (`issue #3662 <https://github.com/platformio/platformio-core/issues/3662>`_)
|
- Fixed an issue when the package manager tries to install a built-in library from the registry (`issue #3662 <https://github.com/platformio/platformio-core/issues/3662>`_)
|
||||||
- Fixed an issue with incorrect value for C++ language standard in IDE projects when an in-progress language standard is used (`issue #3653 <https://github.com/platformio/platformio-core/issues/3653>`_)
|
- Fixed an issue with incorrect value for C++ language standard in IDE projects when an in-progress language standard is used (`issue #3653 <https://github.com/platformio/platformio-core/issues/3653>`_)
|
||||||
|
- Fixed an issue with "Invalid simple block (semantic_version)" from library dependency that refs to an external source (repository, ZIP/Tar archives) (`issue #3658 <https://github.com/platformio/platformio-core/issues/3658>`_)
|
||||||
|
|
||||||
5.0.0 (2020-09-03)
|
5.0.0 (2020-09-03)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
@@ -109,11 +109,16 @@ class LibraryPackageManager(BasePackageManager): # pylint: disable=too-many-anc
|
|||||||
)
|
)
|
||||||
|
|
||||||
def _install_dependency(self, dependency, silent=False):
|
def _install_dependency(self, dependency, silent=False):
|
||||||
spec = PackageSpec(
|
if set(["name", "version"]) <= set(dependency.keys()) and any(
|
||||||
owner=dependency.get("owner"),
|
c in dependency["version"] for c in (":", "/", "@")
|
||||||
name=dependency.get("name"),
|
):
|
||||||
requirements=dependency.get("version"),
|
spec = PackageSpec("%s=%s" % (dependency["name"], dependency["version"]))
|
||||||
)
|
else:
|
||||||
|
spec = PackageSpec(
|
||||||
|
owner=dependency.get("owner"),
|
||||||
|
name=dependency.get("name"),
|
||||||
|
requirements=dependency.get("version"),
|
||||||
|
)
|
||||||
search_filters = {
|
search_filters = {
|
||||||
key: value
|
key: value
|
||||||
for key, value in dependency.items()
|
for key, value in dependency.items()
|
||||||
|
@@ -230,6 +230,41 @@ def test_install_from_registry(isolated_pio_core, tmpdir_factory):
|
|||||||
tm.install("owner/unknown-package-tool", silent=True)
|
tm.install("owner/unknown-package-tool", silent=True)
|
||||||
|
|
||||||
|
|
||||||
|
def test_install_lib_depndencies(isolated_pio_core, tmpdir_factory):
|
||||||
|
tmp_dir = tmpdir_factory.mktemp("tmp")
|
||||||
|
|
||||||
|
src_dir = tmp_dir.join("lib-with-deps").mkdir()
|
||||||
|
root_dir = src_dir.mkdir("root")
|
||||||
|
root_dir.mkdir("src").join("main.cpp").write("#include <stdio.h>")
|
||||||
|
root_dir.join("library.json").write(
|
||||||
|
"""
|
||||||
|
{
|
||||||
|
"name": "lib-with-deps",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"dependencies": [
|
||||||
|
{
|
||||||
|
"owner": "bblanchon",
|
||||||
|
"name": "ArduinoJson",
|
||||||
|
"version": "^6.16.1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "external-repo",
|
||||||
|
"version": "https://github.com/milesburton/Arduino-Temperature-Control-Library.git#4a0ccc1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
lm = LibraryPackageManager(str(tmpdir_factory.mktemp("lib-storage")))
|
||||||
|
lm.install("file://%s" % str(src_dir), silent=True)
|
||||||
|
installed = lm.get_installed()
|
||||||
|
assert len(installed) == 4
|
||||||
|
assert set(["external-repo", "ArduinoJson", "lib-with-deps", "OneWire"]) == set(
|
||||||
|
p.metadata.name for p in installed
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_install_force(isolated_pio_core, tmpdir_factory):
|
def test_install_force(isolated_pio_core, tmpdir_factory):
|
||||||
lm = LibraryPackageManager(str(tmpdir_factory.mktemp("lib-storage")))
|
lm = LibraryPackageManager(str(tmpdir_factory.mktemp("lib-storage")))
|
||||||
# install #64 ArduinoJson
|
# install #64 ArduinoJson
|
||||||
|
Reference in New Issue
Block a user