Skip to content

smart info raises on fresh install #745

Open
@MattToast

Description

@MattToast

Description

When installing SmartSim, if a user runs smart info prior to running smart build, a smartsim/_core/bin directory does not exist, and therefore a FileNotFoundError is raised.

How to reproduce

$ pip install smartsim[dev,mypy]
$ # Very deliberately NOT running `smart build ...` here
$ smart info

Smart Python Packages:
╒════════════╤═══════════╕
│ Name       │ Version   │
╞════════════╪═══════════╡
│ SmartSim   │ 0.8.0     │
│ SmartRedis │ 0.6.1     │
╘════════════╧═══════════╛

Orchestrator Configuration:
Traceback (most recent call last):
  File "/lus/bnchlu1/drozt/repos/ssdev/ss/venv/bin/smart", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/lus/bnchlu1/drozt/repos/ssdev/ss/smartsim/_core/_cli/__main__.py", line 43, in main
    return smart_cli.execute(sys.argv)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lus/bnchlu1/drozt/repos/ssdev/ss/smartsim/_core/_cli/cli.py", line 88, in execute
    return menu_item.handler(args, unparsed_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lus/bnchlu1/drozt/repos/ssdev/ss/smartsim/_core/_cli/info.py", line 33, in execute
    db_path = _utils.get_db_path()
              ^^^^^^^^^^^^^^^^^^^^
  File "/lus/bnchlu1/drozt/repos/ssdev/ss/smartsim/_core/_cli/utils.py", line 123, in get_db_path
    for option in bin_path.iterdir():
  File "/lus/scratch/drozt/.pyenv/versions/3.11.9/lib/python3.11/pathlib.py", line 931, in iterdir
    for name in os.listdir(self):
                ^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/lus/bnchlu1/drozt/repos/ssdev/ss/smartsim/_core/bin'

Expected behavior

smart info should not raise. Instead it should just report that no binaries were found.

System

Any/All

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions