florianschanda / miss_hit

MATLAB Independent, Small & Safe, High Integrity Tools - code formatter and more
GNU General Public License v3.0
158 stars 21 forks source link

Provide a console script entry point for mh_style #281

Closed ThomasFeher closed 9 months ago

ThomasFeher commented 9 months ago

What kind of feature is this?

Your MATLAB/Octave environment (not really relevant)

MISS_HIT component affected

Describe the solution you'd like mh_style should supply a console script entry point as described here in order to support installation via pipx. Other components of miss_hit, like mh_lint, do so already.

florianschanda commented 9 months ago

I don't understand:

https://github.com/florianschanda/miss_hit/blob/f01fbf9cd43c52fdb8fe6dce162c9772637ec199/setup_gpl.py#L44

This is already done, in exactly the same way it is done for mh_lint.

florianschanda commented 9 months ago

I also downloaded the latest published miss_hit_core wheel file, and looked into entry_points.txt:

[console_scripts]
mh_metric = miss_hit_core.mh_metric:main
mh_style = miss_hit_core.mh_style:main

So sounds perhaps like a pipx bug? Either way, MH is doing everything correctly as far as I can tell.

florianschanda commented 9 months ago

I also did a test install in a clean environment (with pip) and the script mh_style is created.

ThomasFeher commented 9 months ago

Maybe this is really an issue with pipx. I tried now installing miss_hit_core explicitly (while having installed miss_hit already) and this added mh_style and mh_metric.

So for anyone having the same issue. The correct way seems to be:

pipx install miss_hit_core
pipx install miss_hit
florianschanda commented 9 months ago

Sounds like pipx is not respecting dependencies...? I have created an issue with them: https://github.com/pypa/pipx/issues/1082

ThomasFeher commented 9 months ago

Thank you. The issue they are referring to suggests using --include-deps, which works for me, as well.

So the better solution ist to:

pipx install --include-deps miss_hit