mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 01:57:13 +02:00
Fixed an issue when saving libraries in new project results in error "No option 'lib_deps' in section" // Resolve #3442
This commit is contained in:
@ -10,6 +10,7 @@ PlatformIO Core 4
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Fixed UnicodeDecodeError on Windows when network drive (NAS) is used (`issue #3417 <https://github.com/platformio/platformio-core/issues/3417>`_)
|
||||
* Fixed an issue when saving libraries in new project results in error "No option 'lib_deps' in section" (`issue #3442 <https://github.com/platformio/platformio-core/issues/3442>`_)
|
||||
|
||||
4.3.1 (2020-03-20)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
@ -29,6 +29,7 @@ from platformio.package.manifest.parser import ManifestParserFactory
|
||||
from platformio.package.manifest.schema import ManifestSchema
|
||||
from platformio.proc import is_ci
|
||||
from platformio.project.config import ProjectConfig
|
||||
from platformio.project.exception import InvalidProjectConfError
|
||||
from platformio.project.helpers import get_project_dir, is_platformio_project
|
||||
|
||||
try:
|
||||
@ -180,7 +181,10 @@ def lib_install( # pylint: disable=too-many-arguments
|
||||
if project_environments and env not in project_environments:
|
||||
continue
|
||||
config.expand_interpolations = False
|
||||
lib_deps = config.get("env:" + env, "lib_deps", [])
|
||||
try:
|
||||
lib_deps = config.get("env:" + env, "lib_deps")
|
||||
except InvalidProjectConfError:
|
||||
lib_deps = []
|
||||
for library in libraries:
|
||||
if library in lib_deps:
|
||||
continue
|
||||
|
@ -121,11 +121,19 @@ def test_defaults(config):
|
||||
assert config.get_optional_dir("core") == os.path.join(
|
||||
os.path.expanduser("~"), ".platformio"
|
||||
)
|
||||
assert config.get("strict_ldf", "lib_deps", ["Empty"]) == ["Empty"]
|
||||
assert config.get("env:extra_2", "lib_compat_mode") == "soft"
|
||||
assert config.get("env:extra_2", "build_type") == "release"
|
||||
assert config.get("env:extra_2", "build_type", None) is None
|
||||
assert config.get("env:extra_2", "lib_archive", "no") is False
|
||||
|
||||
config.expand_interpolations = False
|
||||
with pytest.raises(
|
||||
InvalidProjectConfError, match="No option 'lib_deps' in section: 'strict_ldf'"
|
||||
):
|
||||
assert config.get("strict_ldf", "lib_deps", ["Empty"]) == ["Empty"]
|
||||
config.expand_interpolations = True
|
||||
|
||||
|
||||
def test_sections(config):
|
||||
with pytest.raises(ConfigParser.NoSectionError):
|
||||
|
Reference in New Issue
Block a user