ImageGoNord-pip icon indicating copy to clipboard operation
ImageGoNord-pip copied to clipboard

Add an entry point for build system to properly install the script

Open JinEnMok opened this issue 10 months ago • 4 comments

Modern Python build systems support at least some sort of script variable to define the method to be called when the package is supposed to be a CLI script, e.g. for setup.py this seems to be either scripts or console_scripts (see here for an example).

Would it be possible to add something like that to ImageGoNord? I'm asking because I use pipx to install and maintain my Python CLI tools, and it refused to install ImageGoNord due to lack of such CLI entry point. This improvement would increase the package's reach and make it a bit more convention-conformant.

JinEnMok avatar Apr 26 '24 17:04 JinEnMok

It could be a nice to have. Could you please provide us some examples of other libs?

TheJoin95 avatar Apr 27 '24 14:04 TheJoin95

It appears Magic Wormhole also uses setup.py. If you do want to switch to pyproject.toml, here's an example from frogmouth

JinEnMok avatar Apr 27 '24 14:04 JinEnMok

Hello,

i can address it issue.

It require to migrate to project.toml and use setup as backend. With it method a CLI entry-point can be generate during the pip install.

The entry point should use argparse, on rule of art for keep the control code near that lib (argparse) Look like the exemple can be a good entry point starter.

The entry point should ne complet, well documented , for permit future TUI/GUI implementations.

i send a PR soon

Hierosme avatar Sep 16 '24 07:09 Hierosme

Adressed #30

The entry point is style empty but ready to implement the exemple docs/exemples/index.py I 'll start by implementing the exemple and certainly STDIN / STDOUT as file

Have you a idea about how the entry point CLI should implement ?

image-go-nord image.jpg ./
image-go-nord -y image.jpg ./image-nord.jpg
cat ./image.jpg | image-go-nord -f > ./image-nord.jpg
etc ...

???

Hierosme avatar Sep 16 '24 10:09 Hierosme