HERA-Team / hera_qm

HERA Data Quality Metrics
MIT License
2 stars 2 forks source link

maint: switch to using pyproject.toml instead of setup.py/cfg #455

Closed steven-murray closed 6 months ago

steven-murray commented 6 months ago

This pulls all the code out of setup.py and setup.cfg and puts it in the python-preferred pyproject.toml.

There should be no change of usage with this PR at all, it's just a more modern way of doing things.

A couple of things to note:

  1. The pyproject.toml doesn't support (AFAIK) installing "scripts" the same way as setup.py. In fact, it's much nicer, supporting the more general concept of "entry points". How these should be used is to have each "script" as a function that can be run without arguments, and the pyproject.toml specifies the CLI command to run that function. This can be built into something really nice if you use a CLI builder like click. Here, I haven't done anything nice like that -- I just moved the scripts into the main package (so they get installed) and named their CLI command as the script name (including the .py suffix), so there's no change of usage. I would be happy to update this to be a little more modern, so we'd invoke for example: hera-qm run-xrfi etc. But I'll leave that up to people who use hera_qm more to decide.
  2. I added some ruff rules to the pyproject.toml -- these are simply to reflect the pycodestyle rules that were in the setup.cfg. Note that these rules weren't being enforced in anyway -- we don't have pre-commit setup on this repo -- so adding them here is not doing anything yet. I can make another PR that auto-fixes the rules that aren't ignored.
codecov[bot] commented 6 months ago

Codecov Report

Attention: 404 lines in your changes are missing coverage. Please review.

Comparison is base (84ec3a7) 97.07% compared to head (b28ed11) 82.69%.

Files Patch % Lines
hera_qm/scripts/auto_view.py 0.00% 260 Missing :warning:
hera_qm/scripts/delay_xrfi_h1c_idr2_1_run.py 0.00% 28 Missing :warning:
hera_qm/scripts/xrfi_day_threshold_run.py 0.00% 12 Missing :warning:
hera_qm/scripts/firstcal_metrics_run.py 0.00% 11 Missing :warning:
hera_qm/scripts/omnical_metrics_run.py 0.00% 11 Missing :warning:
hera_qm/scripts/xrfi_apply.py 0.00% 11 Missing :warning:
hera_qm/scripts/xrfi_h1c_run.py 0.00% 11 Missing :warning:
hera_qm/scripts/ant_metrics_run.py 0.00% 10 Missing :warning:
hera_qm/scripts/auto_metrics_run.py 0.00% 10 Missing :warning:
hera_qm/scripts/xrfi_h3c_idr2_1_run.py 0.00% 10 Missing :warning:
... and 3 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #455 +/- ## =========================================== - Coverage 97.07% 82.69% -14.39% =========================================== Files 11 25 +14 Lines 3553 4171 +618 =========================================== Hits 3449 3449 - Misses 104 722 +618 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jsdillon commented 6 months ago

Closing this in favor of #456