trogon icon indicating copy to clipboard operation
trogon copied to clipboard

execvp fix

Open antonio-antuan opened this issue 1 year ago • 3 comments

solves #70

antonio-antuan avatar Jun 10 '24 06:06 antonio-antuan

I've been experiencing issue #70 while running Trogon with my python installation managed by pyenv, and this change fixes it.

In the meantime for anyone else experiencing this issue, manually activating my venv with source ~/.pyenv/path/to/env/bin/activate allows me to run my Trogon app.

DanielMaysWilliams avatar Aug 15 '24 15:08 DanielMaysWilliams

I'm not familiar with pipx. But however are there only two options of "sys.executable": python itself (and its variants) and "mycli-package"?

antonio-antuan avatar Sep 20 '24 19:09 antonio-antuan

pipx isn't necessarily the important bit, as there are a few other common ways by which packages can expose executables. But the crux of this use case is that the CLI app is run by being another executable on the path (via options.entry_points.console_scripts). That executable file, generated by pip machinery, is something like this:

#!/path/to/some/python
# -*- coding: utf-8 -*-
import re
import sys
from mycli.main import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

daneah avatar Sep 20 '24 20:09 daneah