LCVcode / jockey

MIT License
2 stars 3 forks source link

CLI breaks after building and installing snap #48

Closed LCVcode closed 2 weeks ago

LCVcode commented 2 weeks ago

Describe the Bug

After building and installing the juju-jockey snap, the CLI breaks due to a ModuleNotFoundError.

Steps to Reproduce

  1. Pull the latest updates to the master brance
  2. Build the snap with snapcraft
  3. Install the snap with sudo snap install --dangerous ./juju-jockey_0.1.0_amd64.snap --classic
  4. All juju-jockey commands fail

Expected Behavior

No ModuleNotFoundError when running juju-jockey commands.

Environment

Additional Context

Here is the traceback:

juju-jockey info  
Traceback (most recent call last):
  File "/snap/juju-jockey/x1/bin/juju-jockey", line 5, in <module>
    from jockey.__main__ import main
ModuleNotFoundError: No module named 'jockey'

Verification that I do have the snap properly installed:

$ which juju-jockey
/snap/bin/juju-jockey

$ sudo snap info juju-jockey                                            
name:      juju-jockey
summary:   Jockey is a utility for filtering and navigating Juju objects
publisher: –
license:   MIT
description: |
  Jockey is a CLI tool designed to facilitate quick and easy retrieval of Juju objects using
  filters.
  It uses automatic caching of Juju's status in json format to enable faster parsing.
commands:
  - juju-jockey
refresh-date: today at 02:35 MDT
installed:    0.1.0 (x1) 11MB classic
johnlettman commented 2 weeks ago

Interesting, I wonder if we need to provide the lookup path for main. I would've thought Snap would do this for us.

$ ls /snap/juju-jockey/x17/lib/python3.10/site-packages/jockey
core.py  info.md  __init__.py  __main__.py  __pycache__  status_keeper.py