Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gromero committed Oct 24, 2021
1 parent 3771745 commit 7534618
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 12 additions & 1 deletion python/tvm/driver/tvmc/micro.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

"""
Provides support for micro targets (microTVM).
"""
import argparse
import os
from pathlib import Path
Expand Down Expand Up @@ -48,6 +50,10 @@

@register_parser
def add_micro_parser(subparsers, main_parser):
"""Includes parser for 'micro' context and associated subcommands:
create-project, build, and flash.
"""

micro = subparsers.add_parser("micro", help="select micro context.")
micro.set_defaults(func=drive_micro)

Expand Down Expand Up @@ -211,6 +217,8 @@ def drive_micro(args):


def create_project_handler(args):
"""Creates a new project dir."""

if os.path.exists(args.project_dir):
if args.force:
shutil.rmtree(args.project_dir)
Expand Down Expand Up @@ -241,6 +249,8 @@ def create_project_handler(args):


def build_handler(args):
"""Builds a firmware image given a project dir."""

if not os.path.exists(args.project_dir):
raise TVMCException(f"{args.project_dir} doesn't exist.")

Expand Down Expand Up @@ -268,6 +278,7 @@ def build_handler(args):


def flash_handler(args):
"""Flashes a firmware image to a target device given a project dir."""
if not os.path.exists(args.project_dir + "/build"):
raise TVMCException(f"Could not find a build in {args.project_dir}")

Expand Down
2 changes: 2 additions & 0 deletions python/tvm/micro/project_api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@


class ProjectOption(_ProjectOption):
"""Class used to keep the metadata associated to project options."""

def __new__(cls, name, **kw):
"""Override __new__ to force all options except name to be specified as kwargs."""
assert "name" not in kw
Expand Down

0 comments on commit 7534618

Please sign in to comment.