diff --git a/HISTORY.rst b/HISTORY.rst index 21373ada..7bc19c63 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -15,7 +15,7 @@ PlatformIO 3.0 - Check maximum allowed "program" and "data" sizes before uploading/programming (`issue #1412 `_) -3.5.4 (2018-??-??) +3.5.4 (2018-07-03) ~~~~~~~~~~~~~~~~~~ * Improved removing of default build flags using `build_unflags `__ option @@ -27,6 +27,7 @@ PlatformIO 3.0 (`issue #1665 `_) * Handle "architectures" data from "library.properties" manifest in `lib_compat_mode = strict `__ +* Added workaround for Python SemVer package's `issue #61 `_ with caret range and pre-releases * Replaced conflicted "env" pattern by "sysenv" for `"platformio.ini" Dynamic Variables" `__ (`issue #1705 `_) * Removed "date&time" when processing project with `platformio run `__ command diff --git a/docs b/docs index bcc2f38e..a23b54ff 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit bcc2f38e1dc573f7ed446c521cb3cfd1127d1ae5 +Subproject commit a23b54ff4e52bec425969c3a338c5c8de8b1193d diff --git a/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl b/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl index d481de89..b98a0a3f 100644 --- a/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl +++ b/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl @@ -18,6 +18,7 @@ "name": "Win32", % elif systype == "darwin": "name": "Mac", + "macFrameworkPath": [], % else: "name": "Linux", % end diff --git a/platformio/managers/package.py b/platformio/managers/package.py index dd26f000..3e5bd4a0 100644 --- a/platformio/managers/package.py +++ b/platformio/managers/package.py @@ -90,7 +90,8 @@ class PkgRepoMixin(object): reqspec = None if requirements: try: - reqspec = semantic_version.Spec(requirements) + reqspec = self.parse_semver_spec( + requirements, raise_exception=True) except ValueError: pass @@ -98,8 +99,8 @@ class PkgRepoMixin(object): if not self.is_system_compatible(v.get("system")): continue if "platformio" in v.get("engines", {}): - if PkgRepoMixin.PIO_VERSION not in semantic_version.Spec( - v['engines']['platformio']): + if PkgRepoMixin.PIO_VERSION not in self.parse_semver_spec( + v['engines']['platformio'], raise_exception=True): continue specver = semantic_version.Version(v['version']) if reqspec and specver not in reqspec: @@ -224,7 +225,20 @@ class PkgInstallerMixin(object): @staticmethod def parse_semver_spec(value, raise_exception=False): try: - return semantic_version.Spec(value) + # Workaround for ^ issue and pre-releases + # https://github.com/rbarrois/python-semanticversion/issues/61 + requirements = [] + for item in str(value).split(","): + item = item.strip() + if not item: + continue + if item.startswith("^"): + major = semantic_version.Version.coerce(item[1:]).major + requirements.append(">=%s" % major) + requirements.append("<%s" % (int(major) + 1)) + else: + requirements.append(item) + return semantic_version.Spec(*requirements) except ValueError as e: if raise_exception: raise e @@ -480,8 +494,8 @@ class PkgInstallerMixin(object): "Package version %s doesn't satisfy requirements %s" % (tmp_manifest['version'], requirements)) try: - assert tmp_semver and tmp_semver in semantic_version.Spec( - requirements), mismatch_error + assert tmp_semver and tmp_semver in self.parse_semver_spec( + requirements, raise_exception=True), mismatch_error except (AssertionError, ValueError): assert tmp_manifest['version'] == requirements, mismatch_error