From 52f8e98eedcc3430def006d28762cc486b84c092 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 31 May 2022 17:20:56 +0300 Subject: [PATCH] Move "run" command to the root --- platformio/commands/ci.py | 2 +- platformio/debug/helpers.py | 4 ++-- platformio/project/helpers.py | 2 +- platformio/remote/cli.py | 2 +- platformio/{commands => }/run/__init__.py | 0 platformio/{commands/run/command.py => run/cli.py} | 4 ++-- platformio/{commands => }/run/helpers.py | 0 platformio/{commands => }/run/processor.py | 0 platformio/test/runners/base.py | 2 +- tests/commands/test_run.py | 2 +- 10 files changed, 9 insertions(+), 9 deletions(-) rename platformio/{commands => }/run/__init__.py (100%) rename platformio/{commands/run/command.py => run/cli.py} (98%) rename platformio/{commands => }/run/helpers.py (100%) rename platformio/{commands => }/run/processor.py (100%) diff --git a/platformio/commands/ci.py b/platformio/commands/ci.py index 17880196..f1875b23 100644 --- a/platformio/commands/ci.py +++ b/platformio/commands/ci.py @@ -20,10 +20,10 @@ import tempfile import click from platformio import app, fs -from platformio.commands.run.command import cli as cmd_run from platformio.exception import CIBuildEnvsEmpty from platformio.project.commands.init import project_init_cmd, validate_boards from platformio.project.config import ProjectConfig +from platformio.run.cli import cli as cmd_run def validate_path(ctx, param, value): # pylint: disable=unused-argument diff --git a/platformio/debug/helpers.py b/platformio/debug/helpers.py index 0b15d70d..f156cf45 100644 --- a/platformio/debug/helpers.py +++ b/platformio/debug/helpers.py @@ -21,11 +21,11 @@ from hashlib import sha1 from io import BytesIO from platformio.cli import PlatformioCLI -from platformio.commands.run.command import cli as cmd_run -from platformio.commands.run.command import print_processing_header from platformio.compat import IS_WINDOWS, is_bytes from platformio.debug.exception import DebugInvalidOptionsError from platformio.device.list import list_serial_ports +from platformio.run.cli import cli as cmd_run +from platformio.run.cli import print_processing_header from platformio.test.helpers import list_test_names from platformio.test.result import TestSuite from platformio.test.runners.base import TestRunnerOptions diff --git a/platformio/project/helpers.py b/platformio/project/helpers.py index c7b786c8..2ddc68b3 100644 --- a/platformio/project/helpers.py +++ b/platformio/project/helpers.py @@ -142,7 +142,7 @@ load_project_ide_data = load_build_metadata def _load_build_metadata(project_dir, env_names): # pylint: disable=import-outside-toplevel - from platformio.commands.run.command import cli as cmd_run + from platformio.run.cli import cli as cmd_run args = ["--project-dir", project_dir, "--target", "_idedata"] for name in env_names: diff --git a/platformio/remote/cli.py b/platformio/remote/cli.py index 6df9d8a1..c761f92e 100644 --- a/platformio/remote/cli.py +++ b/platformio/remote/cli.py @@ -24,7 +24,6 @@ from time import sleep import click from platformio import fs, proc -from platformio.commands.run.command import cli as cmd_run from platformio.device.commands.monitor import ( apply_project_monitor_options, device_monitor_cmd, @@ -34,6 +33,7 @@ from platformio.device.commands.monitor import ( from platformio.package.manager.core import inject_contrib_pysite from platformio.project.exception import NotPlatformIOProjectError from platformio.project.options import ProjectOptions +from platformio.run.cli import cli as cmd_run from platformio.test.cli import test_cmd diff --git a/platformio/commands/run/__init__.py b/platformio/run/__init__.py similarity index 100% rename from platformio/commands/run/__init__.py rename to platformio/run/__init__.py diff --git a/platformio/commands/run/command.py b/platformio/run/cli.py similarity index 98% rename from platformio/commands/run/command.py rename to platformio/run/cli.py index 16d71bc9..aa1c0d6c 100644 --- a/platformio/commands/run/command.py +++ b/platformio/run/cli.py @@ -22,11 +22,11 @@ import click from tabulate import tabulate from platformio import app, exception, fs, util -from platformio.commands.run.helpers import clean_build_dir, handle_legacy_libdeps -from platformio.commands.run.processor import EnvironmentProcessor from platformio.device.commands.monitor import device_monitor_cmd from platformio.project.config import ProjectConfig from platformio.project.helpers import find_project_dir_above, load_build_metadata +from platformio.run.helpers import clean_build_dir, handle_legacy_libdeps +from platformio.run.processor import EnvironmentProcessor from platformio.test.runners.base import CTX_META_TEST_IS_RUNNING # pylint: disable=too-many-arguments,too-many-locals,too-many-branches diff --git a/platformio/commands/run/helpers.py b/platformio/run/helpers.py similarity index 100% rename from platformio/commands/run/helpers.py rename to platformio/run/helpers.py diff --git a/platformio/commands/run/processor.py b/platformio/run/processor.py similarity index 100% rename from platformio/commands/run/processor.py rename to platformio/run/processor.py diff --git a/platformio/test/runners/base.py b/platformio/test/runners/base.py index 2e49dc08..2a0e6cec 100644 --- a/platformio/test/runners/base.py +++ b/platformio/test/runners/base.py @@ -174,7 +174,7 @@ class TestRunnerBase: def run_project_targets(self, targets): # pylint: disable=import-outside-toplevel - from platformio.commands.run.command import cli as run_cmd + from platformio.run.cli import cli as run_cmd assert self.cmd_ctx return self.cmd_ctx.invoke( diff --git a/tests/commands/test_run.py b/tests/commands/test_run.py index 504c3b00..5a2617fe 100644 --- a/tests/commands/test_run.py +++ b/tests/commands/test_run.py @@ -14,7 +14,7 @@ from pathlib import Path -from platformio.commands.run.command import cli as cmd_run +from platformio.run.cli import cli as cmd_run def test_build_flags(clirunner, validate_cliresult, tmpdir):