Subjectively, there have been more issues recently with contributor PRs
being rejected by ruff. This could possibly be caused by them using a
different ruff version (presumably: more recent). This PR upgrades ruff
to the latest version to hopefully reduce these issues.
The only change needed to make this ruff version pass was to disable
UP045. This rule requires changing code like:
x: Optional[int]
into
x: int | None
in 220 places. Personally, I don't think it's crucial. Moreover, ruff
won't fix this automically, except with --unsafe-fixes (note that Python
3.9 needs a __future__ import for this, so that could be the reason). My
preference is thus just to disable the rule, but LMK if you disagree.
We use ruff for linting. The version is fixed because otherwise, we
formatting changes would creep into random PRs. Thus far, the version
was ~0.6.1 but that's already quite old by now, thus moving to ~v0.9.2.
The ruff changes themselves are all about:
1. Other line breaking logic for asserts with messages
2. More aggressive string normalizaton
Comment
Making these changes is always a bit annoying since existing PRs might
need to be updated, but there is never a really good time to do it.
Moving to ruff ~0.6.1. Changes:
- type comparisons now require is: str is str
- remove overridden class attribute active_adapter
- remove secondary import of fbd_cuda
Omit jupyter notebooks for now. We can think about adding that in a
separate PR.