aria-tools / ARIA-tools

Tools for exploiting ARIA standard products
Apache License 2.0
98 stars 36 forks source link

[WANTED FEATURE] Update `scripts` in `setup.py` to `entry_points` #365

Open cmarshak opened 1 year ago

cmarshak commented 1 year ago

This is a more modern approach, but also will align with our conda-recipe.

See this example: https://github.com/insarlab/MintPy/blob/main/setup.py#L95-L162

Supposedly also helps with better cross platform compatability (read Windows) as indicated here: https://stackoverflow.com/a/28119736

cmarshak commented 1 year ago

See Joe's Writeup linked below -- outlines all pieces that are required

jhkennedy commented 1 year ago

I described console script entry points in detail in this comment for MintPy, which may be helpful here. https://github.com/insarlab/MintPy/issues/652#issuecomment-914038914

sssangha commented 3 days ago

More notes after discussion with the team:

It looks like the disutils.core.Extension isn't being used, so it should be pretty straight forward to migrate by translating between the two forms, which you can flip between here: https://setuptools.pypa.io/en/latest/userguide/quickstart.html

Things that might be worth doing along the way would be using setuptools_scm to get the version number from the git tags instead of the custom code in the setup.py

And these should all be converted to actual console script entry-points: https://setuptools.pypa.io/en/latest/userguide/entry_point.html#console-scripts

The script keyword is discouraged. E.g.:

Pyproject.toml: script-files
    Discouraged - equivalent to the `script` keyword in setup.py. Whenever possible, please use project.scripts instead.

and then actually listing dependencies would be nice, as well as the supported python version

sssangha commented 3 days ago

You can use the asf-hyp3 pyproject.tomls as templates e.g. https://github.com/ASFHyP3/hyp3-lib/blob/develop/pyproject.toml

A better starting point may be the cookiecutter template from the HyP3 folks: https://github.com/ASFHyP3/hyp3-cookiecutter/blob/develop/%7B%7Bcookiecutter.__project_name%7D%7D/pyproject.toml