diff --git a/.github/workflows/codeql-security-scan.yml b/.github/workflows/codeql-security-scan.yml index e40e85b5..1d020dcd 100644 --- a/.github/workflows/codeql-security-scan.yml +++ b/.github/workflows/codeql-security-scan.yml @@ -29,7 +29,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} config-file: ./.github/actions/codeql/security-pack.yml diff --git a/src/fprime/util/commands.py b/src/fprime/util/commands.py index 68cdcb44..6b0d40d0 100644 --- a/src/fprime/util/commands.py +++ b/src/fprime/util/commands.py @@ -59,9 +59,11 @@ def run_info( f"'{target}'": "" for target in build_info.get("global_targets", []) } build_artifacts = ( - build_info.get("auto_location") - if build_info.get("auto_location") is not None - else "N/A", + ( + build_info.get("auto_location") + if build_info.get("auto_location") is not None + else "N/A" + ), build_info.get("build_dir", "Unknown"), ) local_generic_targets.update(local_targets) @@ -194,10 +196,10 @@ def run_version_check( try: import platform - print(f"Python version: {platform.python_version()}") print(f"Operating System: {platform.system()}") print(f"CPU Architecture: {platform.machine()}") print(f"Platform: {platform.platform()}") + print(f"Python version: {platform.python_version()}") except ImportError: # Python >=3.6 print("[WARNING] Cannot import 'platform'.") @@ -228,9 +230,20 @@ def run_version_check( return print("Pip packages:") + # Used to print fprime-fpp-* versions together if they are all the same to de-clutter the output + fpp_packages = {} for tool in FPRIME_PIP_PACKAGES: try: version = pkg_resources.get_distribution(tool).version - print(f" {tool}=={version}") - except (OSError, VersionException) as exc: + if tool.startswith("fprime-fpp-"): + fpp_packages[tool] = version + else: + print(f" {tool}=={version}") + except (OSError, VersionException, pkg_resources.DistributionNotFound) as exc: print(f"[WARNING] {exc}") + if fpp_packages: + if len(set(fpp_packages.values())) == 1: + print(f" fprime-fpp-*=={list(fpp_packages.values())[0]}") + else: + for tool, version in fpp_packages.items(): + print(f" {tool}=={version}") diff --git a/src/fprime/util/cookiecutter_wrapper.py b/src/fprime/util/cookiecutter_wrapper.py index bdc558b8..bad9eb0b 100644 --- a/src/fprime/util/cookiecutter_wrapper.py +++ b/src/fprime/util/cookiecutter_wrapper.py @@ -1,5 +1,6 @@ """ Cookie cutter wrapper used to template out components """ + import glob import os import shutil @@ -227,6 +228,13 @@ def new_module(build: Build, parsed_args: "argparse.Namespace"): def new_project(parsed_args: "argparse.Namespace"): """Creates a new F' project""" + print( + "[DEPRECATED] This command is deprecated and will be removed in a future release." + " Please use `fprime-bootstrap project` instead." + " Install fprime-bootstrap with `pip install fprime-bootstrap`," + " or refer to https://nasa.github.io/fprime/INSTALL.html" + ) + # Check if Git is installed and available - needed for cloning F' as submodule if not shutil.which("git"): print( diff --git a/src/fprime/util/help_text.py b/src/fprime/util/help_text.py index 391826f3..ffb74c08 100644 --- a/src/fprime/util/help_text.py +++ b/src/fprime/util/help_text.py @@ -282,9 +282,8 @@ Usage: -- New Project -- - Generate a new F' project. This will create a Git repository and add F' as a submodule, optionally creating a new - virtual environment. Defaults to current directory, but --path can be used to point to a different location. - Using --overwrite will overwrite only the files that are generated by the new project. + Generating a new project is now available through the fprime-bootstrap package. Please see the F´ Install Guide + at https://nasa.github.io/fprime/INSTALL.html for instructions on how to install and use fprime-bootstrap. -- New Deployment -- Generate a new F' deployment within a F' project. The new deployment command is expected to be ran at the root of the project and will create a new deployment in the current directory. Using --overwrite will overwrite only the