Skip to content

Commit

Permalink
Make PIO Core 4.0 automatically compatible with dev-platforms for PIO…
Browse files Browse the repository at this point in the history
… Core 2.0 & 3.0 // Resolve #3638
  • Loading branch information
ivankravets committed Aug 24, 2020
1 parent 3e7e9e2 commit 6af2bad
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions platformio/platform/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,13 @@ def python_packages(self):
def ensure_engine_compatible(self):
if not self.engines or "platformio" not in self.engines:
return True
if self.CORE_SEMVER in semantic_version.SimpleSpec(self.engines["platformio"]):
core_spec = semantic_version.SimpleSpec(self.engines["platformio"])
if self.CORE_SEMVER in core_spec:
return True
raise IncompatiblePlatform(
self.name, str(self.CORE_SEMVER), self.engines["platformio"]
)
# PIO Core 4 is compatible with dev-platforms for PIO Core 2.0 & 3.0
if any(semantic_version.Version.coerce(str(v)) in core_spec for v in (2, 3)):
return True
raise IncompatiblePlatform(self.name, str(self.CORE_SEMVER), str(core_spec))

def get_dir(self):
return os.path.dirname(self.manifest_path)
Expand Down

0 comments on commit 6af2bad

Please sign in to comment.