diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 52f78ab5d6..9a70cb03b7 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -45,7 +45,7 @@ jobs: uses: actions/setup-python@v6 with: python-version: '3.13' - - run: python -m pip install "isort<6" + - run: python -m pip install isort - name: isort # Pinned to v3.0.0. uses: liskin/gh-problem-matcher-wrap@e7b7beaaafa52524748b31a381160759d68d61fb diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e1d8cec10b..f2a9217d6c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: files: 'docs/.*\.txt$' args: ["--rst-literal-block"] - repo: https://github.com/PyCQA/isort - rev: 5.13.2 + rev: 7.0.0 hooks: - id: isort - repo: https://github.com/PyCQA/flake8 diff --git a/django/db/backends/postgresql/compiler.py b/django/db/backends/postgresql/compiler.py index 344773fb7a..a07ae3ea92 100644 --- a/django/db/backends/postgresql/compiler.py +++ b/django/db/backends/postgresql/compiler.py @@ -1,10 +1,10 @@ -from django.db.models.sql.compiler import ( +from django.db.models.sql.compiler import ( # isort:skip SQLAggregateCompiler, SQLCompiler, SQLDeleteCompiler, + SQLInsertCompiler as BaseSQLInsertCompiler, + SQLUpdateCompiler, ) -from django.db.models.sql.compiler import SQLInsertCompiler as BaseSQLInsertCompiler -from django.db.models.sql.compiler import SQLUpdateCompiler __all__ = [ "SQLAggregateCompiler", diff --git a/docs/internals/contributing/writing-code/coding-style.txt b/docs/internals/contributing/writing-code/coding-style.txt index 72429492cd..499866defa 100644 --- a/docs/internals/contributing/writing-code/coding-style.txt +++ b/docs/internals/contributing/writing-code/coding-style.txt @@ -137,7 +137,7 @@ Imports .. console:: - $ python -m pip install "isort >= 5.1.0" + $ python -m pip install "isort >= 7.0.0" $ isort . This runs ``isort`` recursively from your current directory, modifying any diff --git a/docs/internals/contributing/writing-code/unit-tests.txt b/docs/internals/contributing/writing-code/unit-tests.txt index 974b4861d5..acbf68a7de 100644 --- a/docs/internals/contributing/writing-code/unit-tests.txt +++ b/docs/internals/contributing/writing-code/unit-tests.txt @@ -83,7 +83,7 @@ environments can be seen as follows: blacken-docs flake8>=3.7.0 docs - isort>=5.1.0 + isort>=7.0.0 lint-docs Testing other Python versions and database backends diff --git a/tests/contenttypes_tests/test_views.py b/tests/contenttypes_tests/test_views.py index bec79105c4..eb3ab0a92d 100644 --- a/tests/contenttypes_tests/test_views.py +++ b/tests/contenttypes_tests/test_views.py @@ -8,7 +8,7 @@ from django.contrib.sites.shortcuts import get_current_site from django.http import Http404, HttpRequest from django.test import TestCase, override_settings -from .models import ( +from .models import ( # isort:skip Article, Author, FooWithBrokenAbsoluteUrl, @@ -17,9 +17,9 @@ from .models import ( ModelWithM2MToSite, ModelWithNullFKToSite, SchemeIncludedURL, + Site as MockSite, + UUIDModel, ) -from .models import Site as MockSite -from .models import UUIDModel @override_settings(ROOT_URLCONF="contenttypes_tests.urls") diff --git a/tox.ini b/tox.ini index ec90ceb1e4..4f1274a266 100644 --- a/tox.ini +++ b/tox.ini @@ -75,7 +75,7 @@ commands = [testenv:isort] basepython = python3 usedevelop = false -deps = isort >= 5.1.0 +deps = isort >= 7.0.0 changedir = {toxinidir} commands = isort --check-only --diff django tests scripts