pipx icon indicating copy to clipboard operation
pipx copied to clipboard

Support GUI applications (make "gui_scripts" known to pipx)

Open fladd opened this issue 4 years ago • 5 comments

How would this feature be useful?

The documentation on how pipx works (https://pypa.github.io/pipx/how-pipx-works/) suggests that only functions defined in entry_points as console_scripts are available to pipx after installation. Having functions defined as gui_scripts available, too, would allow to use pipx for GUI applications.

Describe the solution you'd like

When gui_scripts are defined as entry_points in setup.py, pipx should make those available as known commands on the system.

Describe alternatives you've considered

The alternative seems to be to specify GUI applications as console_scripts, which would always open a terminal when run from a place other than a terminal.

fladd avatar Jun 30 '21 15:06 fladd

Sounds like a perfectly valid usage to me. Would you be interested in contributing a PR for this?

uranusjr avatar Jun 30 '21 15:06 uranusjr

I just had a look at the actual code, and it seems that pipx already considers gui_scripts (https://github.com/pypa/pipx/blob/04b817c1bc5cf89515b0a2d89a7232c2212e8c70/src/pipx/venv_inspect.py#L70). I haven't verified this yet, but maybe the documentation is just confusing on this?

fladd avatar Jun 30 '21 16:06 fladd

It could be, I’m not familiar with the exact behaviour either. Could you try locally whether gui_scripts are indeed correctly handled already, and if so, draft some documentation fixes?

uranusjr avatar Jun 30 '21 16:06 uranusjr

PR welcome.

gaborbernat avatar Dec 02 '23 17:12 gaborbernat

I just validated that pipx exposes gui_scripts via pipx install novelwriter -> novelwriter.

Should just be a matter of improving the docs.

Gitznik avatar Feb 04 '24 10:02 Gitznik