From 44380dd62afb29cc274e1598e134d79e8a4b4ee8 Mon Sep 17 00:00:00 2001 From: David Culley <6276049+davidculley@users.noreply.github.com> Date: Sun, 4 Aug 2024 15:54:14 +0200 Subject: [PATCH] Specify Python version for auto-formatters (#3325) * chore(isort): specify Python version to be assumed https://pycqa.github.io/isort/docs/configuration/options#python-version Default is to assume _any_ Python 3 version could be the target. * chore(black): specify Python target versions https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#t-target-version * chore(ruff): specify Python version to be assumed https://docs.astral.sh/ruff/settings/#target-version * chore: exclude directories from auto-formatting --- .isort.cfg | 1 + .ruff.toml | 2 ++ pyproject.toml | 3 +++ qt/.isort.cfg | 1 + 4 files changed, 7 insertions(+) create mode 100644 .ruff.toml create mode 100644 pyproject.toml diff --git a/.isort.cfg b/.isort.cfg index 925b940cd..109f5c21e 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,4 +1,5 @@ [settings] +py_version=39 known_first_party=anki,aqt,tests profile=black extend_skip=qt/bundle diff --git a/.ruff.toml b/.ruff.toml new file mode 100644 index 000000000..498ecbdac --- /dev/null +++ b/.ruff.toml @@ -0,0 +1,2 @@ +target-version = "py39" +extend-exclude = ["qt/bundle"] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..56f5c4aeb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[tool.black] +target-version = ["py39", "py310", "py311", "py312"] +extend-exclude = "qt/bundle" diff --git a/qt/.isort.cfg b/qt/.isort.cfg index 6559fce4f..aa01f87c7 100644 --- a/qt/.isort.cfg +++ b/qt/.isort.cfg @@ -1,4 +1,5 @@ [settings] +py_version=39 profile=black known_first_party=anki,aqt extend_skip=aqt/forms,hooks_gen.py