Schroedinger-Hat / ImageGoNord-pip

A tool that can convert your rgb images to nordtheme palette
https://ign.schroedinger-hat.org
GNU Affero General Public License v3.0
172 stars 13 forks source link

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

Open JinEnMok opened 6 months ago

JinEnMok commented 6 months ago

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.

TheJoin95 commented 6 months ago

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

JinEnMok commented 6 months ago

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

Hierosme commented 2 months ago

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 commented 2 months ago

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 ...

???