Sort imports with isort
Is your feature request related to a problem? Please describe. Imports are unstandardized, adding friction to outside developers contributing.
Describe the solution you'd like
Add in support for isort including a pre-commit hook, and configuration in pyproject.toml. This will not only sort imports, but ensure that all future imports are sorted according to the same specification.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.
### Tasks
- [ ] add isort configuration and dev dependency to pyproject.toml
- [ ] add isort to pre-commit-config.yaml
- [ ] add isort check to ci pipeline
- [ ] sort imports once all configuration is done
We reverted PR #5933 with #5980 as isort and black were conflicting.
Reopening.
Btw, there black / isort compatibility here: https://pycqa.github.io/isort/docs/configuration/black_compatibility.html
Anyway, I enabled checking for the right sorting using ruff here: https://github.com/deepset-ai/haystack/pull/7207