ruff is faster and handle everything we had prior. isort configuration done based on the indication from https://github.com/astral-sh/ruff/issues/4670, previousely based on reorder-python-import (#11896) flake8-docstrings was a wrapper around pydocstyle (now archived) that explicitly asks to use ruff in https://github.com/PyCQA/pydocstyle/pull/658. flake8-typing-import is useful mainly for project that support python 3.7 and the one useful check will be implemented in https://github.com/astral-sh/ruff/issues/2302 We need to keep blacken-doc because ruff does not handle detection of python code inside .md and .rst. The direct link to the repo is now used to avoid a redirection. Manual fixes: - Lines that became too long - % formatting that was not done automatically - type: ignore that were moved around - noqa of hard to fix issues (UP031 generally) - fmt: off and fmt: on that is not really identical between black and ruff - autofix re-order in pre-commit from faster to slower Co-authored-by: Ran Benita <ran@unusedvar.com>
21 lines
595 B
Python
21 lines
595 B
Python
# 10000 iterations, just for relative comparison
|
|
# 2.7.5 3.3.2
|
|
# FilesCompleter 75.1109 69.2116
|
|
# FastFilesCompleter 0.7383 1.0760
|
|
import timeit
|
|
|
|
|
|
imports = [
|
|
"from argcomplete.completers import FilesCompleter as completer",
|
|
"from _pytest._argcomplete import FastFilesCompleter as completer",
|
|
]
|
|
|
|
count = 1000 # only a few seconds
|
|
setup = "%s\nfc = completer()"
|
|
run = 'fc("/d")'
|
|
|
|
|
|
if __name__ == "__main__":
|
|
print(timeit.timeit(run, setup=setup % imports[0], number=count))
|
|
print(timeit.timeit(run, setup=setup % imports[1], number=count))
|