IMAP-Science-Operations-Center / imap-data-access

Package to download, query, and upload files from the IMAP Science Data Center.
MIT License
0 stars 9 forks source link

BUG - module not found when using CLI #81

Closed greglucas closed 3 months ago

greglucas commented 3 months ago

Description of the issue

There is a module-not-found error when invoking the CLI due to a relative import.

/lib/python3.12/site-packages/imap_data_access/cli.py", line 23, in <module>
    from file_validation import ScienceFilePath
ModuleNotFoundError: No module named 'file_validation'

This line needs to be prefixed with imap_data_access. https://github.com/IMAP-Science-Operations-Center/imap-data-access/blob/ff6c637533d39a8c5359f2e456e918f2495b0871/imap_data_access/cli.py#L23

Steps to reproduce the issue

pip install imap-data-access
imap-data-access -h

Expected behavior (What should happen)

Find all modules

Actual behavior (What does happen)

crash

Code Snippet:

No response

Additional notes, affected areas, and suggested fixes

We should add a smoke test for using the CLI too. A new test_cli.py file? Following subprocess calls after the installation similar to https://github.com/IMAP-Science-Operations-Center/imap-data-access/blob/main/tests/test_config_options.py We should be able to install our package and call imap-data-access -h without a crash.

daralynnrhode commented 3 months ago

Yes! I was meaning to get to this. Both me and @bourque found this bug but it seemed to need to be corrected in different ways depending on our virtual environments.