diff --git a/MANIFEST.in b/MANIFEST.in index bbc131d..2818531 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ -include src/west/commands/west-commands-schema.yml +include src/west/west-commands-schema.yml include src/west/manifest-schema.yml diff --git a/setup.py b/setup.py index 97c7470..7089d1e 100644 --- a/setup.py +++ b/setup.py @@ -46,5 +46,5 @@ setuptools.setup( 'packaging', ], python_requires='>=3.6', - entry_points={'console_scripts': ('west = west.main:main',)}, + entry_points={'console_scripts': ('west = west.app.main:main',)}, ) diff --git a/src/west/app/README.txt b/src/west/app/README.txt new file mode 100644 index 0000000..83e8abd --- /dev/null +++ b/src/west/app/README.txt @@ -0,0 +1,8 @@ +The west.app package contains the implementation of the west command +line tool and its built-in features. + +Nothing in this package should be considered API. + +In particular, authors of west extension commands should not rely on +the behavior this package or any of its contents to remain stable over +time. diff --git a/src/west/app/__init__.py b/src/west/app/__init__.py new file mode 100644 index 0000000..9d49dc4 --- /dev/null +++ b/src/west/app/__init__.py @@ -0,0 +1,3 @@ +# Copyright (c) 2020, Nordic Semiconductor ASA + +# nothing here diff --git a/src/west/commands/config.py b/src/west/app/config.py similarity index 100% rename from src/west/commands/config.py rename to src/west/app/config.py diff --git a/src/west/main.py b/src/west/app/main.py similarity index 99% rename from src/west/main.py rename to src/west/app/main.py index 5ef3f56..a22cba5 100755 --- a/src/west/main.py +++ b/src/west/app/main.py @@ -29,9 +29,9 @@ from west import log from west import configuration as config from west.commands import WestCommand, extension_commands, \ CommandError, ExtensionCommandError -from west.commands.project import List, ManifestCommand, Diff, Status, \ +from west.app.project import List, ManifestCommand, Diff, Status, \ SelfUpdate, ForAll, Init, Update, Topdir -from west.commands.config import Config +from west.app.config import Config from west.manifest import Manifest, MalformedConfig, MalformedManifest, \ ManifestVersionError, ManifestImportFailed, \ ManifestProject, MANIFEST_REV_BRANCH diff --git a/src/west/commands/project.py b/src/west/app/project.py similarity index 100% rename from src/west/commands/project.py rename to src/west/app/project.py diff --git a/src/west/commands/__init__.py b/src/west/commands.py similarity index 99% rename from src/west/commands/__init__.py rename to src/west/commands.py index 88872e7..e9be819 100644 --- a/src/west/commands/__init__.py +++ b/src/west/commands.py @@ -22,7 +22,6 @@ from west.util import escapes_directory This package provides WestCommand, which is the common abstraction all west commands subclass. -All built-in west commands are implemented as modules in this package. This package also provides support for extension commands.''' __all__ = ['CommandContextError', 'CommandError', 'WestCommand'] @@ -131,6 +130,8 @@ class WestCommand(ABC): return self.parser + + # # Mandatory subclass hooks # diff --git a/src/west/commands/west-commands-schema.yml b/src/west/west-commands-schema.yml similarity index 100% rename from src/west/commands/west-commands-schema.yml rename to src/west/west-commands-schema.yml diff --git a/tests/test_help.py b/tests/test_help.py index c229ac4..734243c 100644 --- a/tests/test_help.py +++ b/tests/test_help.py @@ -5,7 +5,7 @@ import itertools import os import sys -from west.main import BUILTIN_COMMAND_GROUPS +from west.app.main import BUILTIN_COMMAND_GROUPS from conftest import cmd def test_builtin_help_and_dash_h(west_init_tmpdir):