diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 00c7db3..bb42e99 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,13 +25,6 @@ repos: - repo: local hooks: - - id: isort - name: isort-local - entry: isort - language: python - types: [python] - exclude: .+/(settings|migrations)/.+ - pass_filenames: true - id: eslint name: eslint-local entry: npm run lint diff --git a/.ruff.toml b/.ruff.toml index f5b3785..1811643 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -16,3 +16,18 @@ target-version = "py38" quote-style = "double" indent-style = "space" line-ending = "auto" + +[lint.isort.sections] +django = ["django"] +drf = ["rest_framework"] + +[lint.isort] +section-order = [ + "future", + "standard-library", + "django", + "drf", + "third-party", + "first-party", + "local-folder", +] diff --git a/manage.py b/manage.py index a22657d..9a352b8 100755 --- a/manage.py +++ b/manage.py @@ -1,5 +1,6 @@ #!/usr/bin/env python """Django's command-line utility for administrative tasks.""" + import os import sys diff --git a/requirements/dev.txt b/requirements/dev.txt index bc89434..7c4b2cf 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.10 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --output-file=requirements/dev.txt requirements/base.in requirements/dev.in requirements/quality.in @@ -17,8 +17,6 @@ astroid==2.15.8 # requirements-detector authlib==1.3.0 # via safety -backports-tarfile==1.1.1 - # via jaraco-context bandit==1.7.8 # via -r requirements/quality.in build==1.2.1 @@ -71,13 +69,9 @@ flake8-polyfill==1.0.2 idna==3.7 # via requests importlib-metadata==7.1.0 - # via - # keyring - # twine + # via twine isort==5.13.2 - # via - # -r requirements/quality.in - # pylint + # via pylint jaraco-classes==3.4.0 # via keyring jaraco-context==5.3.0 @@ -226,6 +220,8 @@ ruamel-yaml==0.18.6 # safety-schemas ruamel-yaml-clib==0.2.8 # via ruamel-yaml +ruff==0.4.5 + # via -r requirements/quality.in safety==3.2.0 # via -r requirements/quality.in safety-schemas==0.0.2 @@ -248,14 +244,6 @@ stevedore==5.2.0 # via bandit toml==0.10.2 # via requirements-detector -tomli==2.0.1 - # via - # build - # dparse - # pip-tools - # pylint - # pyproject-api - # tox tomlkit==0.12.5 # via pylint tox==3.28.0 @@ -270,8 +258,6 @@ typer==0.12.3 # via safety typing-extensions==4.11.0 # via - # asgiref - # astroid # pydantic # pydantic-core # safety diff --git a/requirements/doc.txt b/requirements/doc.txt index 855f38f..5da7b05 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.10 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --output-file=requirements/doc.txt requirements/base.in requirements/doc.in @@ -73,11 +73,5 @@ sqlparse==0.5.0 # via django stevedore==5.2.0 # via doc8 -tomli==2.0.1 - # via - # doc8 - # sphinx -typing-extensions==4.11.0 - # via asgiref urllib3==2.2.1 # via requests diff --git a/requirements/quality.in b/requirements/quality.in index 150c6d6..eda2b8e 100644 --- a/requirements/quality.in +++ b/requirements/quality.in @@ -1,10 +1,10 @@ # Requirements for code quality checks -isort # to standardize order of imports astroid pylint # linter for python pylint_django # pylint plugin for django pylint_celery # pylint plugin for celery bandit safety -prospector \ No newline at end of file +ruff # Python linter and code formatter +prospector diff --git a/requirements/quality.txt b/requirements/quality.txt index 39d6658..1078f2f 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.10 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --output-file=requirements/quality.txt requirements/quality.in @@ -44,9 +44,7 @@ flake8-polyfill==1.0.2 idna==3.7 # via requests isort==5.13.2 - # via - # -r requirements/quality.in - # pylint + # via pylint jinja2==3.1.4 # via safety lazy-object-proxy==1.10.0 @@ -142,6 +140,8 @@ ruamel-yaml==0.18.6 # safety-schemas ruamel-yaml-clib==0.2.8 # via ruamel-yaml +ruff==0.4.5 + # via -r requirements/quality.in safety==3.2.0 # via -r requirements/quality.in safety-schemas==0.0.2 @@ -158,17 +158,12 @@ stevedore==5.2.0 # via bandit toml==0.10.2 # via requirements-detector -tomli==2.0.1 - # via - # dparse - # pylint tomlkit==0.12.5 # via pylint typer==0.12.3 # via safety typing-extensions==4.11.0 # via - # astroid # pydantic # pydantic-core # safety diff --git a/requirements/test.txt b/requirements/test.txt index bb20b27..958af4a 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.10 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --output-file=requirements/test.txt requirements/base.in requirements/test.in @@ -7,16 +7,12 @@ asgiref==3.8.1 # via django coverage[toml]==7.5.1 - # via - # coverage - # pytest-cov + # via pytest-cov # via # djangorestframework # model-bakery djangorestframework==3.15.1 # via -r requirements/base.in -exceptiongroup==1.2.1 - # via pytest iniconfig==2.0.0 # via pytest model-bakery==1.18.0 @@ -36,9 +32,3 @@ pytest-django==4.8.0 # via -r requirements/test.in sqlparse==0.5.0 # via django -tomli==2.0.1 - # via - # coverage - # pytest -typing-extensions==4.11.0 - # via asgiref diff --git a/setup.cfg b/setup.cfg index 5066936..5e40900 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,9 +1,2 @@ -[isort] -line_length = 120 -known_django = django -known_djangoapp = model_utils -known_first_party = drf_rw_serializers -sections = FUTURE,STDLIB,THIRDPARTY,DJANGO,DJANGOAPP,FIRSTPARTY,LOCALFOLDER - [wheel] universal = 1