From 8e95ea95676b5ea79c3becc3b51d1160279cd4c2 Mon Sep 17 00:00:00 2001 From: Sandeep Suryaprasad <26169602+sandeepsuryaprasad@users.noreply.github.com> Date: Tue, 29 Oct 2024 18:27:50 +0530 Subject: [PATCH] [py] moved `isort`, `black` and `docformatter` settings from `tox.ini` file to `pyproject.toml` (#14671) * moved isort,black and docformatter settings to pyproject.toml * moved isort, black and docformatter settings to pyproject.toml * removed redundant pytest settings from setup.cfg --- py/pyproject.toml | 16 ++++++++++++++++ py/setup.cfg | 5 ----- py/tox.ini | 11 ----------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/py/pyproject.toml b/py/pyproject.toml index 87d451bbf987f..8a5e26071de6a 100644 --- a/py/pyproject.toml +++ b/py/pyproject.toml @@ -61,3 +61,19 @@ ignore_missing_imports = true [[tool.mypy._winreg]] # suppress error messages about imports that cannot be resolved. ignore_missing_imports = true + +[tool.isort] +# isort is a common python tool for keeping imports nicely formatted. +# Automatically keep imports alphabetically sorted, on single lines in +# PEP recommended sections (https://peps.python.org/pep-0008/#imports) +# files or individual lines can be ignored via `# isort:skip|# isort:skip_file`. +profile = "black" +py_version=38 +force_single_line = true + +[tool.black] +line-length = 120 +target-version = ['py38'] + +[tool.docformatter] +recursive = true diff --git a/py/setup.cfg b/py/setup.cfg index 0cda7cace9e8c..c8eb38080b7d3 100644 --- a/py/setup.cfg +++ b/py/setup.cfg @@ -4,8 +4,3 @@ exclude = .tox,docs/source/conf.py,*venv extend-ignore = E501, E203 # This does nothing for now as E501 is ignored. max-line-length = 120 - -[tool:pytest] -addopts = -ra -python_files = test_*.py *_tests.py -testpaths = test diff --git a/py/tox.ini b/py/tox.ini index f454af1ee3347..fefb4daa3997f 100644 --- a/py/tox.ini +++ b/py/tox.ini @@ -25,17 +25,6 @@ deps = trio-typing==0.7.0 commands = mypy --install-types {posargs} - -[isort] -; isort is a common python tool for keeping imports nicely formatted. -; Automatically keep imports alphabetically sorted, on single lines in -; PEP recommended sections (https://peps.python.org/pep-0008/#imports) -; files or individual lines can be ignored via `# isort:skip|# isort:skip_file`. -profile = black -py_version=38 -force_single_line = True - - [testenv:linting-ci] ; checks linting for CI with stricter exiting when failing. skip_install = true