forked from platformio/platformio-core
Fixed an issue when can not remove update or remove external dev-platform using PlatformIO Home // Resolve #3663
This commit is contained in:
@ -18,6 +18,7 @@ PlatformIO Core 5
|
|||||||
- 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>`_)
|
- 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>`_)
|
||||||
|
- Fixed an issue when can not remove update or remove external dev-platform using PlatformIO Home (`issue #3663 <https://github.com/platformio/platformio-core/issues/3663>`_)
|
||||||
|
|
||||||
5.0.0 (2020-09-03)
|
5.0.0 (2020-09-03)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -209,6 +209,7 @@ class PackageSpec(object): # pylint: disable=too-many-instance-attributes
|
|||||||
raw = raw.strip()
|
raw = raw.strip()
|
||||||
|
|
||||||
parsers = (
|
parsers = (
|
||||||
|
self._parse_local_file,
|
||||||
self._parse_requirements,
|
self._parse_requirements,
|
||||||
self._parse_custom_name,
|
self._parse_custom_name,
|
||||||
self._parse_id,
|
self._parse_id,
|
||||||
@ -227,10 +228,16 @@ class PackageSpec(object): # pylint: disable=too-many-instance-attributes
|
|||||||
# the leftover is a package name
|
# the leftover is a package name
|
||||||
self.name = raw
|
self.name = raw
|
||||||
|
|
||||||
def _parse_requirements(self, raw):
|
@staticmethod
|
||||||
if "@" not in raw:
|
def _parse_local_file(raw):
|
||||||
|
if raw.startswith("file://") or not any(c in raw for c in ("/", "\\")):
|
||||||
return raw
|
return raw
|
||||||
if raw.startswith("file://") and os.path.exists(raw[7:]):
|
if os.path.exists(raw):
|
||||||
|
return "file://%s" % raw
|
||||||
|
return raw
|
||||||
|
|
||||||
|
def _parse_requirements(self, raw):
|
||||||
|
if "@" not in raw or raw.startswith("file://"):
|
||||||
return raw
|
return raw
|
||||||
tokens = raw.rsplit("@", 1)
|
tokens = raw.rsplit("@", 1)
|
||||||
if any(s in tokens[1] for s in (":", "/")):
|
if any(s in tokens[1] for s in (":", "/")):
|
||||||
|
@ -90,12 +90,13 @@ def test_spec_local_urls(tmpdir_factory):
|
|||||||
assert PackageSpec("file:///tmp/some-lib/") == PackageSpec(
|
assert PackageSpec("file:///tmp/some-lib/") == PackageSpec(
|
||||||
url="file:///tmp/some-lib/", name="some-lib"
|
url="file:///tmp/some-lib/", name="some-lib"
|
||||||
)
|
)
|
||||||
assert PackageSpec("file:///tmp/foo.tar.gz@~2.3.0-beta.1") == PackageSpec(
|
# detached package
|
||||||
url="file:///tmp/foo.tar.gz", name="foo", requirements="~2.3.0-beta.1"
|
assert PackageSpec("file:///tmp/some-lib@src-67e1043a673d2") == PackageSpec(
|
||||||
|
url="file:///tmp/some-lib@src-67e1043a673d2", name="some-lib"
|
||||||
)
|
)
|
||||||
# detached folder with "@" symbol
|
# detached folder without scheme
|
||||||
pkg_dir = tmpdir_factory.mktemp("storage").join("detached@1.2.3").mkdir()
|
pkg_dir = tmpdir_factory.mktemp("storage").join("detached@1.2.3").mkdir()
|
||||||
assert PackageSpec("file://%s" % str(pkg_dir)) == PackageSpec(
|
assert PackageSpec(str(pkg_dir)) == PackageSpec(
|
||||||
name="detached", url="file://%s" % pkg_dir
|
name="detached", url="file://%s" % pkg_dir
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user