icecube / flarestack

Unbinned likelihood analysis code for astroparticle physics datasets
https://flarestack.readthedocs.io/en/latest/?badge=latest
MIT License
8 stars 6 forks source link

use `black` 2024 #347

Open JannisNe opened 4 months ago

JannisNe commented 4 months ago

For now black version 2023 is pinned in pyproject.toml and #346 also pins it in the CI job. At some point we can switch to newer formatting. Maybe when people are not in the middle of analyses.

mlincett commented 4 months ago

We could also consider switching to ruff (although that can potentially do much more linting).

robertdstein commented 4 months ago

Can I suggest something like this: https://github.com/winter-telescope/wintertoo/blob/main/.github/workflows/black.yml

Basically, install black via pip/poetry rather than using the pre-built github action. That forces the two versions to always be aligned.

robertdstein commented 4 months ago

The advantage is that dependabot can then do the updating for you

mlincett commented 4 months ago

Can I suggest something like this: https://github.com/winter-telescope/wintertoo/blob/main/.github/workflows/black.yml

Basically, install black via pip/poetry rather than using the pre-built github action. That forces the two versions to always be aligned.

I did that in the past for flarestack. Then I recall the upstream black action had been updated to pick up the black version from the repository, so I reverted the workflow to use the action. Not sure why the behaviour changed once again, but I agree that is better to run black ourselves from within the setup.

JannisNe commented 4 months ago

So future todo: run black manually and use poetry version from pyproject.toml.