Apply new repo-review suggestion RF003
RF003: src directory doesn't need to be specified anymore (0.6+)
Ruff now (0.6+) looks in the src directory by default. The src setting doesn't need to be specified if it's just set to ["src"].
CAVEAT: Removing src = ["src"] results in changes related to the I rules, as suggested by the 0.6.0 release announcement;
By default, our
isortrules now search insidesrc/directories when determining the list of package names that are likely to represent first-party code. This was always configurable, but it was suprising for many users that Ruff didn't understand this common project structure "out of the box".This change may result in some of your imports being reordered or recategorised, as import statements that these rules previously considered to be third-party imports will now be correctly understood as first-party.
I tried this myself after seeing the ruff changelog but it produces wrong import sorting, from pip._vendor.* is supposed to be marked as 3rd party as per the config:
known-third-party = ["pip._vendor"]
But this PR moves pip._vendor.* to be first party with pip._internal.*. This is either a bug in ruff or something in the ruff config needs to be updated.
Indeed, this doesn't seem right. Pehraps related to https://github.com/astral-sh/ruff/issues/10266.
OP in that issue says known-third-party is a workaround for their issue, but in this example known-third-party is not helping.
It might be the same as this https://github.com/astral-sh/ruff/issues/12984.
Thanks for your interest in contributing to pip, however, this can be revisited when the relevant Ruff bug(s) are fixed.