sesh / ready

Are you production ready?
ISC License
26 stars 4 forks source link

`ready --doc` fails when installed via pipx #25

Closed mejofi closed 5 months ago

mejofi commented 5 months ago

When installed via pipx, with pipx install ready-check, ready --doc fails with a FileNotFoundError;

$ ready --doc 
Traceback (most recent call last):
  File "/home/qa/.local/bin/ready", line 8, in <module>
    sys.exit(ready.cli())
             ^^^^^^^^^^^
  File "/home/qa/.local/pipx/venvs/ready-check/lib/python3.11/site-packages/ready/ready.py", line 347, in cli
    for filename in os.listdir("./ready/checks"):
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: './ready/checks'

This is with the pipx that ships with with Debian Bookworm;

https://packages.debian.org/bookworm/pipx

$ which pipx
/usr/bin/pipx

$ /usr/bin/pipx --version
1.1.0

Sorry for the number of opened issues, it's one of those Fridays, hope you don't mind 😄

sesh commented 5 months ago

No problem about the number of issues, I'll have a look at them over the weekend.

Glad someone is finding the tool useful.

sesh commented 5 months ago

I have pushed a quick fix for this one. For my own notes, the fix is based on this Stack Overflow question: https://stackoverflow.com/questions/6028000/how-to-read-a-static-file-from-inside-a-python-package