Deprecate "pio update", "pio lib", and "pio platform" commands

This commit is contained in:
Ivan Kravets
2022-05-17 18:57:40 +03:00
parent abf6304818
commit 92073a4ccd
5 changed files with 23 additions and 30 deletions

View File

@ -16,7 +16,7 @@ PlatformIO Core 6
~~~~~~~~~~~~~~~~~~
* Improved support for the renamed configuration options (`issue #4270 <https://github.com/platformio/platformio-core/issues/4270>`_)
* Fixed an issue when calling the built-in `pio device monitor <https://docs.platformio.org/en/latest/core/userguide/device/cmd_monitor.html#filters>`__ filter
* Fixed an issue when calling the built-in `pio device monitor <https://docs.platformio.org/en/latest/core/userguide/device/cmd_monitor.html#filters>`__ filters
* Fixed an issue when using |INTERPOLATION| and merging str+int options (`issue #4271 <https://github.com/platformio/platformio-core/issues/4271>`_)
6.0.0 (2022-05-16)

2
docs

Submodule docs updated: dfef63a7f1...2ea8592203

View File

@ -68,6 +68,14 @@ def get_project_global_lib_dir():
)
@click.pass_context
def cli(ctx, **options):
in_silence = PlatformioCLI.in_silence()
if not in_silence:
click.secho(
"\nWARNING!!! This command is deprecated and will be removed in "
"the next releases. \nPlease use `pio pkg` instead.\n",
fg="yellow",
)
storage_cmds = ("install", "uninstall", "update", "list")
# skip commands that don't need storage folder
if ctx.invoked_subcommand not in storage_cmds or (
@ -94,7 +102,6 @@ def cli(ctx, **options):
get_project_dir(), get_project_global_lib_dir(), ctx.invoked_subcommand
)
in_silence = PlatformioCLI.in_silence()
ctx.meta[CTX_META_PROJECT_ENVIRONMENTS_KEY] = options["environment"]
ctx.meta[CTX_META_INPUT_DIRS_KEY] = storage_dirs
ctx.meta[CTX_META_STORAGE_DIRS_KEY] = []

View File

@ -18,6 +18,7 @@ import os
import click
from platformio.commands import PlatformioCLI
from platformio.commands.boards import print_boards
from platformio.exception import UserSideException
from platformio.package.exception import UnknownPackageError
@ -30,7 +31,12 @@ from platformio.platform.factory import PlatformFactory
@click.group(short_help="Platform manager", hidden=True)
def cli():
pass
if not PlatformioCLI.in_silence():
click.secho(
"\nWARNING!!! This command is deprecated and will be removed in "
"the next releases. \nPlease use `pio pkg` instead.\n",
fg="yellow",
)
@cli.command("search", short_help="Search for development platform")

View File

@ -14,12 +14,6 @@
import click
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.platform import platform_update as cmd_platform_update
from platformio.package.manager.core import update_core_packages
from platformio.package.manager.library import LibraryPackageManager
@click.command(
"update",
@ -36,23 +30,9 @@ from platformio.package.manager.library import LibraryPackageManager
@click.option(
"--dry-run", is_flag=True, help="Do not update, only check for the new versions"
)
@click.pass_context
def cli(ctx, core_packages, only_check, dry_run):
only_check = dry_run or only_check
if not only_check:
update_core_packages()
if core_packages:
return
click.echo()
click.echo("Platform Manager")
click.echo("================")
ctx.invoke(cmd_platform_update, only_check=only_check)
click.echo()
click.echo("Library Manager")
click.echo("===============")
ctx.meta[CTX_META_STORAGE_DIRS_KEY] = [LibraryPackageManager().package_dir]
ctx.invoke(cmd_lib_update, only_check=only_check)
def cli(*_, **__):
click.secho(
"This command is deprecated and will be removed in the next releases. \n"
"Please use `pio pkg update` instead.",
fg="yellow",
)