nasa/fprime-gds

Cannot test fresh install of F prime due to NameError: name 'Path' is not defined

Closed this issue · 4 comments

F´ Version fprime from master branch, fprime-gds==3.1.1
Affected Component fprime-gds

Problem Description

I was following the F' Installation Guide, and followed the steps successfully up until "Testing F´ GDS Installation Via Running HTML GUI".

That had me run the command

fprime-gds -g html -r ./build-artifacts

which failed with the following exception

Traceback (most recent call last):
  File "/Users/xxx/.pyenv/versions/fprime-stock/bin/fprime-gds", line 8, in <module>
    sys.exit(main())
  File "/Users/xxx/.pyenv/versions/3.10.4/envs/fprime-stock/lib/python3.10/site-packages/fprime_gds/executables/run_deployment.py", line 277, in main
    settings = vars(get_settings())
  File "/Users/xxx/.pyenv/versions/3.10.4/envs/fprime-stock/lib/python3.10/site-packages/fprime_gds/executables/run_deployment.py", line 23, in get_settings
    root = Path(args.root_dir)
NameError: name 'Path' is not defined

How to Reproduce

  1. Do a fresh checkout of F', and following installation guide

Expected Behavior

I would expect the command to work correctly, starting up the fprime-gds and allowing me to continue with the tutorial.

Thoughts on root cause

I suspect this is caused by commit 97f5492, which removed the line from pathlib import Path from run_deployment.py.

Related tickets

This was also reported in the main fprime system: nasa/fprime#1562

I think this commit may also have caused some other issues with a forgotten import sys in executables/utils.py

I moved forward one, but then hit this error

[ERROR] binary location /Users/russell/src/other/fprime/build-artifacts/Darwin/bin does not exist
Traceback (most recent call last):
  File "/Users/xxx/.pyenv/versions/fprime-stock/bin/fprime-gds", line 8, in <module>
    sys.exit(main())
  File "/Users/xxx/.pyenv/versions/3.10.4/envs/fprime-stock/lib/python3.10/site-packages/fprime_gds/executables/run_deployment.py", line 277, in main
    settings = vars(get_settings())
  File "/Users/xxx/.pyenv/versions/3.10.4/envs/fprime-stock/lib/python3.10/site-packages/fprime_gds/executables/run_deployment.py", line 29, in get_settings
    args.app = fprime_gds.executables.utils.find_app(root)
  File "/Users/xxx/.pyenv/versions/3.10.4/envs/fprime-stock/lib/python3.10/site-packages/fprime_gds/executables/utils.py", line 152, in find_app
    sys.exit(-1)
NameError: name 'sys' is not defined

I think I failed to do proper testing when I submitted that patch, although pytest did pass. I will fix these tonight.

That would be awesome @codeflight1 . I created a pull request with what I think would fix these two errors (#87), feel free to take anything from that PR into your eventual fix.

I also wonder if we should add some of the static analysis tools like pylama and pre-commit to this repository, like in the main fprime.

Closing this issue as it was fixed by the above PR