There's no point in reading dependencies out of pyproject.toml project.dependencies because -e . will already install these. So holistically it makes more sense to include all dependency groups too. I think probably not optional dependencies since these might be incompatible (I don't recall the precise way this works out - check out the uv docs as to whether special syntax is necessary for that).
In any case, we would benefit from doing this because when adding none-backend support for Bitbucket pipelines I realise we need the test dependencies etc. and we can't really infer these except from the section.