Ruff 0.16.0 compatibility changes (#833)