LLNL / hatchet

Graph-indexed Pandas DataFrames for analyzing hierarchical performance data
https://llnl-hatchet.readthedocs.io
MIT License
29 stars 18 forks source link

Upgrades the version of black used in CI #131

Closed ilumsden closed 5 months ago

ilumsden commented 5 months ago

@draganagrbicllnl has been running into issues with black while trying to get formatting working in her PR #126. After looking at our CI, I realized we were using a 2.5 year old version of black with quite a few known bugs. The version of black we were using was particularly problematic since it was a beta version.

This PR upgrades black in CI to the newest version that supports our target Python version (3.9).

ilumsden commented 5 months ago

@pearce8 I've updated the title and description.

I was originally going to upgrade flake8 as well, but every newer version I tried had some type of internal error. This is likely to do a version mismatch between flake8 and one of the other tools it uses behind the scenes. flake8 is really just a thin wrapper around 3 or 4 other formatting tools by the same authors. The biggest problem with flake8 is that its dependencies on those other tools are hyper-specific. Sometimes when those dependencies are off even by a patch version, flake8 breaks when you try to run it.

Regarding the part of your comment asking for a "reason for the version choice", the last sentence (shown below) covers that:

This PR upgrades black in CI to the newest version that supports our target Python version (3.9).

There wasn't any other complex reason for the choice. It was just the newest version supporting the Python version that we use when running black and flake8 in CI. It is also coincidentally the newest version of black in general.

ilumsden commented 5 months ago

FWIW, the issues I ran into with flake8 are also a big reason why a lot of developers are looking different tools for formatting and linting in Python (e.g., ruff).