From b501d6c162062074db2c5391937a797503dfc4be Mon Sep 17 00:00:00 2001 From: Ali Mosallaei Date: Thu, 1 Aug 2024 11:17:59 -0700 Subject: [PATCH] Add subtopology generation with fprime-util new --subtopologies (#203) --- .github/actions/spelling/expect.txt | 3 + docs/conf.py | 1 + .../common/models/serialize/array_type.py | 9 ++- .../common/models/serialize/bool_type.py | 1 + .../common/models/serialize/enum_type.py | 1 + .../models/serialize/numerical_types.py | 1 + .../models/serialize/serializable_type.py | 1 + .../common/models/serialize/string_type.py | 1 + src/fprime/constants.py | 1 + .../hooks/post_gen_project.py | 1 + .../cookiecutter.json | 9 +++ .../hooks/pre_gen_project.py | 8 +++ .../CMakeLists.txt | 12 ++++ .../{{cookiecutter.subtopology_name}}/TODO.md | 27 +++++++++ .../docs/sdd.md | 56 +++++++++++++++++++ .../intentionally-empty.cpp | 7 +++ .../{{cookiecutter.subtopology_name}}.fpp | 31 ++++++++++ ...{cookiecutter.subtopology_name}}Config.fpp | 23 ++++++++ ...ecutter.subtopology_name}}TopologyDefs.hpp | 30 ++++++++++ src/fprime/fbuild/builder.py | 1 + src/fprime/fbuild/cli.py | 1 + src/fprime/fbuild/cmake.py | 1 + src/fprime/fbuild/gcovr.py | 1 + src/fprime/fbuild/settings.py | 1 + src/fprime/fbuild/target.py | 1 + src/fprime/fbuild/target_definitions.py | 1 + src/fprime/fpp/common.py | 1 + src/fprime/fpp/impl.py | 1 - src/fprime/fpp/visualize.py | 1 + src/fprime/util/__main__.py | 1 + src/fprime/util/build_helper.py | 1 + src/fprime/util/cli.py | 8 +++ src/fprime/util/commands.py | 3 + src/fprime/util/cookiecutter_wrapper.py | 42 ++++++++++++++ src/fprime/util/help_text.py | 3 + src/fprime/util/versioning.py | 1 + .../common/models/serialize/test_types.py | 1 + test/fprime/fbuild/test_build.py | 1 + 38 files changed, 290 insertions(+), 4 deletions(-) create mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/cookiecutter.json create mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/hooks/pre_gen_project.py create mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/CMakeLists.txt create mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/TODO.md create mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/docs/sdd.md create mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/intentionally-empty.cpp create mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/{{cookiecutter.subtopology_name}}.fpp create mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/{{cookiecutter.subtopology_name}}Config.fpp create mode 100644 src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/{{cookiecutter.subtopology_name}}TopologyDefs.hpp diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 2b7a1b73..bf3279f5 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -1,3 +1,4 @@ +aei argc atoi bak @@ -148,6 +149,7 @@ memset metadata mkdir mkdtemp +mosa mstarch mul MULTILINE @@ -252,6 +254,7 @@ toctree todo toolchain toolchains +TOPOLOGYCONFIG TOPOLOGYDEFS truediv typehints diff --git a/docs/conf.py b/docs/conf.py index d1bd5cd6..5fc17cf7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,6 +3,7 @@ Documentation: https://www.sphinx-doc.org/en/master/usage/configuration.html """ + # pylint: disable=invalid-name import re diff --git a/src/fprime/common/models/serialize/array_type.py b/src/fprime/common/models/serialize/array_type.py index c238f3e7..2ae07b52 100644 --- a/src/fprime/common/models/serialize/array_type.py +++ b/src/fprime/common/models/serialize/array_type.py @@ -3,6 +3,7 @@ Created on May 29, 2020 @author: jishii """ + from fprime.util.string_util import format_string_template from . import serializable_type @@ -95,9 +96,11 @@ def to_jsonable(self): "type": self.__class__.__name__, "size": self.LENGTH, "format": self.FORMAT, - "values": None - if self._val is None - else [member.to_jsonable() for member in self._val], + "values": ( + None + if self._val is None + else [member.to_jsonable() for member in self._val] + ), } def serialize(self): diff --git a/src/fprime/common/models/serialize/bool_type.py b/src/fprime/common/models/serialize/bool_type.py index 01c900e0..b66beaf8 100644 --- a/src/fprime/common/models/serialize/bool_type.py +++ b/src/fprime/common/models/serialize/bool_type.py @@ -2,6 +2,7 @@ Created on Dec 18, 2014 @author: tcanham, reder """ + import struct from .type_base import ValueType diff --git a/src/fprime/common/models/serialize/enum_type.py b/src/fprime/common/models/serialize/enum_type.py index 5b815a99..b5d1b179 100644 --- a/src/fprime/common/models/serialize/enum_type.py +++ b/src/fprime/common/models/serialize/enum_type.py @@ -2,6 +2,7 @@ Created on Dec 18, 2014 @author: tcanham, reder """ + import struct from .type_base import DictionaryType diff --git a/src/fprime/common/models/serialize/numerical_types.py b/src/fprime/common/models/serialize/numerical_types.py index 67f8892b..6d65aa13 100644 --- a/src/fprime/common/models/serialize/numerical_types.py +++ b/src/fprime/common/models/serialize/numerical_types.py @@ -6,6 +6,7 @@ @author mstarch """ + import abc import struct diff --git a/src/fprime/common/models/serialize/serializable_type.py b/src/fprime/common/models/serialize/serializable_type.py index 70c0ceab..824efc54 100644 --- a/src/fprime/common/models/serialize/serializable_type.py +++ b/src/fprime/common/models/serialize/serializable_type.py @@ -4,6 +4,7 @@ @author: tcanham """ + from fprime.util.string_util import format_string_template from . import array_type diff --git a/src/fprime/common/models/serialize/string_type.py b/src/fprime/common/models/serialize/string_type.py index 34391cbf..c7905d3a 100644 --- a/src/fprime/common/models/serialize/string_type.py +++ b/src/fprime/common/models/serialize/string_type.py @@ -4,6 +4,7 @@ @author: tcanham """ + import struct from fprime.constants import DATA_ENCODING diff --git a/src/fprime/constants.py b/src/fprime/constants.py index cc8cba66..c19d8c91 100644 --- a/src/fprime/constants.py +++ b/src/fprime/constants.py @@ -1,6 +1,7 @@ """ Provided constants for use within the fprime system. """ + # pylint: disable=W0105 """ In order to transmit data in a serialized format, string objects need to be encoded. Otherwise, diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/hooks/post_gen_project.py b/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/hooks/post_gen_project.py index 95ca5d59..ee029301 100644 --- a/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/hooks/post_gen_project.py +++ b/src/fprime/cookiecutter_templates/cookiecutter-fprime-project/hooks/post_gen_project.py @@ -9,6 +9,7 @@ @author thomas-bc """ + import subprocess import sys import requests diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/cookiecutter.json b/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/cookiecutter.json new file mode 100644 index 00000000..7e60ea67 --- /dev/null +++ b/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/cookiecutter.json @@ -0,0 +1,9 @@ +{ + "subtopology_name": "MySubtopology", + "subtopology_desc": "My Subtopology Description", + "__subtopology_name_upper": "{{cookiecutter.subtopology_name.upper()}}", + "__prompts__": { + "subtopology_name": "Subtopology name", + "subtopology_desc": "Subtopology description" + } +} diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/hooks/pre_gen_project.py b/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/hooks/pre_gen_project.py new file mode 100644 index 00000000..29c07963 --- /dev/null +++ b/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/hooks/pre_gen_project.py @@ -0,0 +1,8 @@ +from fprime.util.cookiecutter_wrapper import is_valid_name + +name = "{{ cookiecutter.subtopology_name }}" + +if is_valid_name(name) != "valid": + raise ValueError( + f"Unacceptable subtopology name: {name}. Do not use spaces or special characters" + ) diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/CMakeLists.txt b/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/CMakeLists.txt new file mode 100644 index 00000000..b816255c --- /dev/null +++ b/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/CMakeLists.txt @@ -0,0 +1,12 @@ +set(SOURCE_FILES + "${CMAKE_CURRENT_LIST_DIR}/{{cookiecutter.subtopology_name}}.fpp" + "${CMAKE_CURRENT_LIST_DIR}/intentionally-empty.cpp" +) + +register_fprime_module() + +set_target_properties( + ${FPRIME_CURRENT_MODULE} + PROPERTIES + SOURCES "${CMAKE_CURRENT_LIST_DIR}/intentionally-empty.cpp" +) \ No newline at end of file diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/TODO.md b/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/TODO.md new file mode 100644 index 00000000..f57d073d --- /dev/null +++ b/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/TODO.md @@ -0,0 +1,27 @@ +# {{cookiecutter.subtopology_name}} - F' Subtopology + +The starter files for the subtopology have been generated. To fully integrate it into your project, you need to do the following steps: + +1. Add the `{{cookiecutter.subtopology_name}}/` folder to its parent directory's `.cmake (or CMakeLists)` file if not already there: + +```cmake +add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/{{cookiecutter.subtopology_name}}/") +``` + +2. Create a directory in the root of your project called `SubtopologyConfigs`. This will include the config files for your subtopologies. Move `{{cookiecutter.subtopology_name}}Config.fpp` into `SubtopologyConfigs`. Create a CMakeLists.txt file in the folder, and include the config file as a source file: + +```cmake +# in SubtopologyConfigs/CMakeLists.txt + +set(SOURCE_FILES + ... + "${CMAKE_CURRENT_LIST_DIR}/{{cookiecutter.subtopology_name}}Config.fpp" + ... +) + +register_fprime_module() +``` + +3. Lastly, add `add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/SubtopologyConfigs/")` to your `project.cmake` folder. + +In the future, you only need to add the config file to your source list. The directory setup should be a one-time event. \ No newline at end of file diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/docs/sdd.md b/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/docs/sdd.md new file mode 100644 index 00000000..e55c4c55 --- /dev/null +++ b/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/docs/sdd.md @@ -0,0 +1,56 @@ +# Subtopology `{{cookiecutter.subtopology_name}}` + +{{cookiecutter.subtopology_desc}} + +> Utilizes the [F Prime Subtopology autocoder](https://github.com/mosa11aei/fprime-subtopology-tool). + +## Related Diagrams +Add any related diagrams here + +## Requirements +Add requirements in the chart below +| Name | Description | Validation | +|---|---|---| +|---|---|---| + +## Instantiation + +``` +# TODO: EDIT THIS + +topology Inst {} +@> + + # note that subtopologies are written with phases, which means inline c++ within this fpp file. + # here is an example: + # instance myCoolComponent: Components.CoolComponent base id {{cookiecutter.subtopology_name}}Config.{{cookiecutter.subtopology_name}}_BASE_ID + << OFFSET >> \ + # queue size {{cookiecutter.subtopology_name}}Config.Defaults.QUEUE_SIZE \ + # stack size {{cookiecutter.subtopology_name}}Config.Defaults.STACK_SIZE \ + # priority {{cookiecutter.subtopology_name}}Config.Priorities.CoolComponent \ + # { + # phase Fpp.ToCpp.Phases.configComponents """ + # { + # # some configuration function calls as necessary + # } + # """ + # } + + @ {{cookiecutter.subtopology_desc}} + topology {{cookiecutter.subtopology_name}} { + + # include any instance declarations here + # and wiring connections as well. For example: + + # instance framer + # connections Framer { + # ... + # } + + } # end topology +} # end {{cookiecutter.subtopology_name}} \ No newline at end of file diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/{{cookiecutter.subtopology_name}}Config.fpp b/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/{{cookiecutter.subtopology_name}}Config.fpp new file mode 100644 index 00000000..de12838c --- /dev/null +++ b/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/{{cookiecutter.subtopology_name}}Config.fpp @@ -0,0 +1,23 @@ +module {{cookiecutter.subtopology_name}}Config { + # Base ID for your subtopology. All instantiated components will be offsets of this + constant {{cookiecutter.subtopology_name}}_BASE_ID = << FILL THIS IN >> + + # include default Queue and Stack sizes here + module Defaults { + constant QUEUE_SIZE = 10 + constant STACK_SIZE = 64 * 1024 + } + + # Priorities for active components should be included in a module like so: + # module Priorities { + # const instanceName = 100 + # ... + # } + + # Custom ports in your subtopology can be defined like so: + # port customPort ( + # ... + # ) + + # Any other constants can go here as well that configure your subtopology +} \ No newline at end of file diff --git a/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/{{cookiecutter.subtopology_name}}TopologyDefs.hpp b/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/{{cookiecutter.subtopology_name}}TopologyDefs.hpp new file mode 100644 index 00000000..23f525a1 --- /dev/null +++ b/src/fprime/cookiecutter_templates/cookiecutter-fprime-subtopology/{{cookiecutter.subtopology_name}}/{{cookiecutter.subtopology_name}}TopologyDefs.hpp @@ -0,0 +1,30 @@ +#ifndef {{cookiecutter.__subtopology_name_upper}}_DEFS_HPP +#define {{cookiecutter.__subtopology_name_upper}}_DEFS_HPP + +namespace {{cookiecutter.subtopology_name}} { + struct {{cookiecutter.subtopology_name}}State { + /* include any variables that are needed for + configuring/starting/tearing down the topology */ + }; + struct TopologyState { + {{cookiecutter.subtopology_name}}State {{cookiecutter.subtopology_name}}_state; + }; +} + +namespace GlobalDefs { + namespace PingEntries { + /* include any ping entries that are needed for the subtopology + e.g., rate groups need FAIL and WARN ping enums + For example: + + namespace {{cookiecutter.subtopology_name}}_rateGroup { + enum { + WARN = 3, + FATAL = 5 + }; + } + */ + } +} + +#endif \ No newline at end of file diff --git a/src/fprime/fbuild/builder.py b/src/fprime/fbuild/builder.py index 7ca93987..ff9f640a 100644 --- a/src/fprime/fbuild/builder.py +++ b/src/fprime/fbuild/builder.py @@ -2,6 +2,7 @@ Supplies high-level build functions to the greater fprime helper CLI. This maps from user command space to the specific build system handler underneath. """ + import os import re from pathlib import Path diff --git a/src/fprime/fbuild/cli.py b/src/fprime/fbuild/cli.py index af70c1ea..46721e10 100644 --- a/src/fprime/fbuild/cli.py +++ b/src/fprime/fbuild/cli.py @@ -5,6 +5,7 @@ @author mstarch """ + import argparse from pathlib import Path from typing import Callable, Dict, List, Tuple diff --git a/src/fprime/fbuild/cmake.py b/src/fprime/fbuild/cmake.py index 23ea642b..f4b66b60 100644 --- a/src/fprime/fbuild/cmake.py +++ b/src/fprime/fbuild/cmake.py @@ -7,6 +7,7 @@ @author mstarch """ + # Get a cache directory for building CMakeList file, if need and remove at exit import collections import copy diff --git a/src/fprime/fbuild/gcovr.py b/src/fprime/fbuild/gcovr.py index 4e17116e..b7dee63d 100644 --- a/src/fprime/fbuild/gcovr.py +++ b/src/fprime/fbuild/gcovr.py @@ -1,4 +1,5 @@ """ fprime.fbuild.gcovr: coverage target implementations """ + import itertools import shutil import subprocess diff --git a/src/fprime/fbuild/settings.py b/src/fprime/fbuild/settings.py index 40c195a3..cc1a1fc7 100644 --- a/src/fprime/fbuild/settings.py +++ b/src/fprime/fbuild/settings.py @@ -6,6 +6,7 @@ @author mstarch """ + import configparser import os import sys diff --git a/src/fprime/fbuild/target.py b/src/fprime/fbuild/target.py index 9920b216..7a68d671 100644 --- a/src/fprime/fbuild/target.py +++ b/src/fprime/fbuild/target.py @@ -5,6 +5,7 @@ @author lestarch """ + import functools import itertools from abc import ABC, abstractmethod diff --git a/src/fprime/fbuild/target_definitions.py b/src/fprime/fbuild/target_definitions.py index 62e7b057..3d38837c 100644 --- a/src/fprime/fbuild/target_definitions.py +++ b/src/fprime/fbuild/target_definitions.py @@ -4,6 +4,7 @@ as such, each target need only be instantiated but need not be assigned to anything. """ + from .gcovr import GcovrTarget from .target import BuildSystemTarget, TargetScope from .types import BuildType diff --git a/src/fprime/fpp/common.py b/src/fprime/fpp/common.py index 2c9cc91c..4ff8dc9f 100644 --- a/src/fprime/fpp/common.py +++ b/src/fprime/fpp/common.py @@ -4,6 +4,7 @@ @author mstarch """ + import itertools import subprocess from pathlib import Path diff --git a/src/fprime/fpp/impl.py b/src/fprime/fpp/impl.py index 10e4717d..cc8d3010 100644 --- a/src/fprime/fpp/impl.py +++ b/src/fprime/fpp/impl.py @@ -5,7 +5,6 @@ @author thomas-bc """ - import argparse import os import tempfile diff --git a/src/fprime/fpp/visualize.py b/src/fprime/fpp/visualize.py index aa5ba4e7..99409bb1 100644 --- a/src/fprime/fpp/visualize.py +++ b/src/fprime/fpp/visualize.py @@ -2,6 +2,7 @@ @author thomas-bc """ + import argparse import shutil import subprocess diff --git a/src/fprime/util/__main__.py b/src/fprime/util/__main__.py index 41892613..a62f80be 100644 --- a/src/fprime/util/__main__.py +++ b/src/fprime/util/__main__.py @@ -4,6 +4,7 @@ This acts as the main entry point for the fprime.util module. This allows users to run fprime.util as an entry point. This will include the build_helper scripts and run them. """ + import sys import fprime.util.cli diff --git a/src/fprime/util/build_helper.py b/src/fprime/util/build_helper.py index 0893e7d0..b054f639 100644 --- a/src/fprime/util/build_helper.py +++ b/src/fprime/util/build_helper.py @@ -13,6 +13,7 @@ @author mstarch """ + from pathlib import Path from fprime.fbuild.builder import Build, BuildType diff --git a/src/fprime/util/cli.py b/src/fprime/util/cli.py index e23435ed..1c401011 100644 --- a/src/fprime/util/cli.py +++ b/src/fprime/util/cli.py @@ -4,6 +4,7 @@ @author mstarch """ + import argparse import os import re @@ -180,6 +181,13 @@ def add_special_parsers( dest="new_project", help="Generate a new project", ) + new_exclusive.add_argument( + "--subtopology", + default=False, + action="store_true", + dest="new_subtopology", + help="Generate a new subtopology", + ) # Code formatting with clang-format format_parser = subparsers.add_parser( diff --git a/src/fprime/util/commands.py b/src/fprime/util/commands.py index d083ae8b..7d2700bf 100644 --- a/src/fprime/util/commands.py +++ b/src/fprime/util/commands.py @@ -24,6 +24,7 @@ new_deployment, new_module, new_project, + new_subtopology, ) @@ -138,6 +139,8 @@ def run_new( return new_module(build, parsed) if parsed.new_project: return new_project(parsed) + if parsed.new_subtopology: + return new_subtopology(build, parsed) raise NotImplementedError( "`fprime-util new` target is missing or not implemented. See usage (--help)." ) diff --git a/src/fprime/util/cookiecutter_wrapper.py b/src/fprime/util/cookiecutter_wrapper.py index 935a4ad9..ed9a57ea 100644 --- a/src/fprime/util/cookiecutter_wrapper.py +++ b/src/fprime/util/cookiecutter_wrapper.py @@ -189,6 +189,48 @@ def new_deployment(build: Build, parsed_args: "argparse.Namespace"): return 0 +def new_subtopology(build: Build, parsed_args: "argparse.Namespace"): + """Creates a new subtopology using cookiecutter""" + # Checks if subtopology_cookiecutter is set in settings.ini file, else uses local install template as default + if ( + build.get_settings("subtopology_cookiecutter", None) is not None + and build.get_settings("subtopology_cookiecutter", None) != "default" + ): + source = build.get_settings("subtopology_cookiecutter", None) + print(f"[INFO] Cookiecutter source: {source}") + else: + source = ( + os.path.dirname(__file__) + + "/../cookiecutter_templates/cookiecutter-fprime-subtopology" + ) + print("[INFO] Cookiecutter: using builtin template for new subtopology") + try: + gen_path = Path( + cookiecutter(source, overwrite_if_exists=parsed_args.overwrite) + ).resolve() + # Attempt to register to CMakeLists.txt or project.cmake + register_with_cmake( + gen_path, + Path(build.get_settings("project_root", None)).resolve(), + build.cmake_root, + ) + + except OutputDirExistsException as out_directory_error: + print( + f"{out_directory_error}. Use --overwrite to overwrite (will not delete non-generated files).", + file=sys.stderr, + ) + return 1 + except FileNotFoundError as e: + print( + f"{e}. Permission denied to write to the directory.", + file=sys.stderr, + ) + return 1 + print(f"[INFO] New subtopology successfully created: {gen_path}") + return 0 + + def new_module(build: Build, parsed_args: "argparse.Namespace"): """Creates a new F' project""" diff --git a/src/fprime/util/help_text.py b/src/fprime/util/help_text.py index ffb74c08..0cbc17d6 100644 --- a/src/fprime/util/help_text.py +++ b/src/fprime/util/help_text.py @@ -15,6 +15,7 @@ @author lestarch """ + import os import sys @@ -292,6 +293,8 @@ Generate a new F' component within a F' project. This command prompts for what type of component and what it should include. At the end of the generation, the user can chose to automatically add the component to the build system and run the implementation generator. + -- New Subtopology -- + Generate a new F' subtopology. This command prompts for the name of the subtopology, and outputs a folder containing the structure for one. The user can then add the subtopology to their own project depending on where the subtopology is generated. """, "format": f"""Format C/C++ files using clang-format diff --git a/src/fprime/util/versioning.py b/src/fprime/util/versioning.py index 68f783c8..e2aa2f2a 100644 --- a/src/fprime/util/versioning.py +++ b/src/fprime/util/versioning.py @@ -1,4 +1,5 @@ """ FPP tools to requirements file version check """ + import argparse import sys from pathlib import Path diff --git a/test/fprime/common/models/serialize/test_types.py b/test/fprime/common/models/serialize/test_types.py index a3f0c15f..e299a8ca 100644 --- a/test/fprime/common/models/serialize/test_types.py +++ b/test/fprime/common/models/serialize/test_types.py @@ -4,6 +4,7 @@ Created on Jun 25, 2020 @author: hpaulson, mstarch """ + import json from collections.abc import Iterable diff --git a/test/fprime/fbuild/test_build.py b/test/fprime/fbuild/test_build.py index 429f0c03..e806613d 100644 --- a/test/fprime/fbuild/test_build.py +++ b/test/fprime/fbuild/test_build.py @@ -6,6 +6,7 @@ @author mstarch """ + import os import pathlib