forked from platformio/platformio-core
Show a warning message about deprecated support for Python 2 and Python 3.5
This commit is contained in:
@@ -16,6 +16,7 @@ PlatformIO Core 5
|
|||||||
- Updated analysis tools:
|
- Updated analysis tools:
|
||||||
* `Cppcheck <https://docs.platformio.org/page/plus/check-tools/cppcheck.html>`__ v2.3 with improved C++ parser and several new MISRA rules
|
* `Cppcheck <https://docs.platformio.org/page/plus/check-tools/cppcheck.html>`__ v2.3 with improved C++ parser and several new MISRA rules
|
||||||
* `PVS-Studio <https://docs.platformio.org/page/plus/check-tools/pvs-studio.html>`__ v7.11 with new diagnostics and updated mass suppression mechanism
|
* `PVS-Studio <https://docs.platformio.org/page/plus/check-tools/pvs-studio.html>`__ v7.11 with new diagnostics and updated mass suppression mechanism
|
||||||
|
- Show a warning message about deprecated support for Python 2 and Python 3.5
|
||||||
- Do not provide "intelliSenseMode" option when generating configuration for VSCode C/C++ extension
|
- Do not provide "intelliSenseMode" option when generating configuration for VSCode C/C++ extension
|
||||||
- Fixed a "git-sh-setup: file not found" error when installing project dependencies from Git VCS (`issue #3740 <https://github.com/platformio/platformio-core/issues/3740>`_)
|
- Fixed a "git-sh-setup: file not found" error when installing project dependencies from Git VCS (`issue #3740 <https://github.com/platformio/platformio-core/issues/3740>`_)
|
||||||
|
|
||||||
@@ -139,7 +140,8 @@ Please check `Migration guide from 4.x to 5.0 <https://docs.platformio.org/page/
|
|||||||
- Display system-wide information using a new `pio system info <https://docs.platformio.org/page/core/userguide/system/cmd_info.html>`__ command (`issue #3521 <https://github.com/platformio/platformio-core/issues/3521>`_)
|
- Display system-wide information using a new `pio system info <https://docs.platformio.org/page/core/userguide/system/cmd_info.html>`__ command (`issue #3521 <https://github.com/platformio/platformio-core/issues/3521>`_)
|
||||||
- Remove unused data using a new `pio system prune <https://docs.platformio.org/page/core/userguide/system/cmd_prune.html>`__ command (`issue #3522 <https://github.com/platformio/platformio-core/issues/3522>`_)
|
- Remove unused data using a new `pio system prune <https://docs.platformio.org/page/core/userguide/system/cmd_prune.html>`__ command (`issue #3522 <https://github.com/platformio/platformio-core/issues/3522>`_)
|
||||||
- Show ignored project environments only in the verbose mode (`issue #3641 <https://github.com/platformio/platformio-core/issues/3641>`_)
|
- Show ignored project environments only in the verbose mode (`issue #3641 <https://github.com/platformio/platformio-core/issues/3641>`_)
|
||||||
- Do not escape compiler arguments in VSCode template on Windows.
|
- Do not escape compiler arguments in VSCode template on Windows
|
||||||
|
- Drop support for Python 2 and 3.5.
|
||||||
|
|
||||||
.. _release_notes_4:
|
.. _release_notes_4:
|
||||||
|
|
||||||
|
2
docs
2
docs
Submodule docs updated: 164a38d3e1...af6575ed90
2
examples
2
examples
Submodule examples updated: 9ab9621241...1ca5e8db4b
@@ -62,10 +62,11 @@ def ci_strings_are_equal(a, b):
|
|||||||
|
|
||||||
|
|
||||||
def ensure_python3(raise_exception=True):
|
def ensure_python3(raise_exception=True):
|
||||||
if not raise_exception or not PY2:
|
compatible = sys.version_info >= (3, 6)
|
||||||
return not PY2
|
if not raise_exception or compatible:
|
||||||
|
return compatible
|
||||||
raise UserSideException(
|
raise UserSideException(
|
||||||
"Python 3.5 or later is required for this operation. \n"
|
"Python 3.6 or later is required for this operation. \n"
|
||||||
"Please install the latest Python 3 and reinstall PlatformIO Core using "
|
"Please install the latest Python 3 and reinstall PlatformIO Core using "
|
||||||
"installation script:\n"
|
"installation script:\n"
|
||||||
"https://docs.platformio.org/page/core/installation.html"
|
"https://docs.platformio.org/page/core/installation.html"
|
||||||
|
@@ -27,6 +27,7 @@ from platformio.commands.lib.command import CTX_META_STORAGE_DIRS_KEY
|
|||||||
from platformio.commands.lib.command import lib_update as cmd_lib_update
|
from platformio.commands.lib.command import lib_update as cmd_lib_update
|
||||||
from platformio.commands.platform import platform_update as cmd_platform_update
|
from platformio.commands.platform import platform_update as cmd_platform_update
|
||||||
from platformio.commands.upgrade import get_latest_version
|
from platformio.commands.upgrade import get_latest_version
|
||||||
|
from platformio.compat import ensure_python3
|
||||||
from platformio.package.manager.core import update_core_packages
|
from platformio.package.manager.core import update_core_packages
|
||||||
from platformio.package.manager.library import LibraryPackageManager
|
from platformio.package.manager.library import LibraryPackageManager
|
||||||
from platformio.package.manager.platform import PlatformPackageManager
|
from platformio.package.manager.platform import PlatformPackageManager
|
||||||
@@ -43,8 +44,25 @@ def on_platformio_start(ctx, force, caller):
|
|||||||
set_caller(caller)
|
set_caller(caller)
|
||||||
telemetry.on_command()
|
telemetry.on_command()
|
||||||
|
|
||||||
if not PlatformioCLI.in_silence():
|
if PlatformioCLI.in_silence():
|
||||||
after_upgrade(ctx)
|
return
|
||||||
|
|
||||||
|
after_upgrade(ctx)
|
||||||
|
|
||||||
|
if not ensure_python3(raise_exception=False):
|
||||||
|
click.secho(
|
||||||
|
"""
|
||||||
|
Python 2 and Python 3.5 are not compatible with PlatformIO Core 5.0.
|
||||||
|
Please check the migration guide on how to fix this warning message:
|
||||||
|
""",
|
||||||
|
fg="yellow",
|
||||||
|
)
|
||||||
|
click.secho(
|
||||||
|
"https://docs.platformio.org/en/latest/core/migration.html"
|
||||||
|
"#drop-support-for-python-2-and-3-5",
|
||||||
|
fg="blue",
|
||||||
|
)
|
||||||
|
click.echo("")
|
||||||
|
|
||||||
|
|
||||||
def on_platformio_end(ctx, result): # pylint: disable=unused-argument
|
def on_platformio_end(ctx, result): # pylint: disable=unused-argument
|
||||||
|
Reference in New Issue
Block a user