Do not shutdown PIO Home Server for "upgrade" operations // Resolve #2784

This commit is contained in:
Ivan Kravets
2019-07-15 18:19:40 +03:00
parent bbf829fe92
commit 425c1fb0a8
3 changed files with 1 additions and 22 deletions

View File

@ -10,6 +10,7 @@ PlatformIO 4.0
~~~~~~~~~~~~~~~~~~
* Print `debug tool <http://docs.platformio.org/en/latest/plus/debugging.html#tools-debug-probes>`__ name for the active debugging session
* Do not shutdown PIO Home Server for "upgrade" operations (`issue #2784 <https://github.com/platformio/platformio-core/issues/2784>`_)
* Fixed an issue with incorrect escaping of Windows slashes when using `PIO Unified Debugger <http://docs.platformio.org/en/latest/plus/debugging.html>`__ and "piped" openOCD
4.0.0 (2019-07-10)

View File

@ -21,7 +21,6 @@ import requests
from platformio import VERSION, __version__, exception, util
from platformio.compat import WINDOWS
from platformio.managers.core import shutdown_piohome_servers
from platformio.proc import exec_command, get_pythonexe_path
from platformio.project.helpers import get_project_cache_dir
@ -38,9 +37,6 @@ def cli(dev):
click.secho("Please wait while upgrading PlatformIO ...", fg="yellow")
# kill all PIO Home servers, they block `pioplus` binary
shutdown_piohome_servers()
to_develop = dev or not all(c.isdigit() for c in __version__ if c != ".")
cmds = (["pip", "install", "--upgrade",
get_pip_package(to_develop)], ["platformio", "--version"])

View File

@ -16,9 +16,6 @@ import os
import subprocess
import sys
from os.path import dirname, join
from time import sleep
import requests
from platformio import __version__, exception, util
from platformio.compat import PY2, WINDOWS
@ -99,25 +96,10 @@ def update_core_packages(only_check=False, silent=False):
if not pkg_dir:
continue
if not silent or pm.outdated(pkg_dir, requirements):
if name == "tool-pioplus" and not only_check:
shutdown_piohome_servers()
if WINDOWS:
sleep(1)
pm.update(name, requirements, only_check=only_check)
return True
def shutdown_piohome_servers():
port = 8010
while port < 8050:
try:
requests.get("http://127.0.0.1:%d?__shutdown__=1" % port,
timeout=0.01)
except: # pylint: disable=bare-except
pass
port += 1
def inject_contrib_pysite():
from site import addsitedir
contrib_pysite_dir = get_core_package_dir("contrib-pysite")