Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PyCQA/isort
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5.10.1
Choose a base ref
...
head repository: PyCQA/isort
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5.11.0
Choose a head ref

Commits on Oct 3, 2021

  1. Copy the full SHA
    3c9573b View commit details

Commits on Nov 12, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b83e742 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    abfb25f View commit details

Commits on Nov 14, 2021

  1. Update dependencies

    timothycrosley committed Nov 14, 2021
    Copy the full SHA
    f65cf5e View commit details
  2. Poetry update

    timothycrosley committed Nov 14, 2021
    Copy the full SHA
    6100d1d View commit details
  3. Merge pull request #1850 from anirudnits/add-multiple-config-document…

    …ation
    
    Add multiple config documentation
    timothycrosley authored Nov 14, 2021
    Copy the full SHA
    874d86a View commit details
  4. Fix integration test

    timothycrosley committed Nov 14, 2021
    Copy the full SHA
    2036723 View commit details
  5. Copy the full SHA
    4dff0f0 View commit details

Commits on Nov 16, 2021

  1. Merge pull request #1822 from sgaist/issue/1729

    doc: Add examples for frozenset and tuple settings
    timothycrosley authored Nov 16, 2021
    Copy the full SHA
    2bc4f42 View commit details
  2. Copy the full SHA
    a129f7f View commit details
  3. Copy the full SHA
    acf6679 View commit details
  4. Fix mkdocs version

    timothycrosley committed Nov 16, 2021
    Copy the full SHA
    7eb671a View commit details

Commits on Nov 17, 2021

  1. Copy the full SHA
    32865ef View commit details

Commits on Nov 18, 2021

  1. Copy the full SHA
    6ad53f4 View commit details

Commits on Nov 19, 2021

  1. Copy the full SHA
    32c95c7 View commit details

Commits on Nov 20, 2021

  1. Copy the full SHA
    63c7fa4 View commit details

Commits on Nov 21, 2021

  1. Copy the full SHA
    f2b1dbd View commit details

Commits on Nov 22, 2021

  1. Copy the full SHA
    84db699 View commit details

Commits on Nov 23, 2021

  1. Copy the full SHA
    9f2f54f View commit details
  2. Copy the full SHA
    0ea444f View commit details
  3. Copy the full SHA
    4a8d2f6 View commit details
  4. Copy the full SHA
    6a730a0 View commit details
  5. Add tox config example

    umonaca authored Nov 23, 2021
    Copy the full SHA
    bc780d8 View commit details
  6. Merge pull request #1856 from umonaca/patch-1

    Add tox config example
    timothycrosley authored Nov 23, 2021
    Copy the full SHA
    86c0ee0 View commit details
  7. Format code

    timothycrosley committed Nov 23, 2021
    Copy the full SHA
    1ec58e7 View commit details
  8. Copy the full SHA
    3345c4d View commit details

Commits on Nov 25, 2021

  1. Improve coveage

    timothycrosley committed Nov 25, 2021
    Copy the full SHA
    3ddd965 View commit details
  2. Remove redundant multi_line_output = 3 from "Compatibility with black"

    According to the profiles documentation:
    https://pycqa.github.io/isort/docs/configuration/profiles.html
    
    The black profiles contains: "multi_line_output = 3". Avoid confusion on
    the "Compatibility with black" page by not adding a redundant option.
    The reader may believe the extra "multi_line_output" is required.
    
    This came up in a real world scenario:
    pypa/pyproject-hooks#137 (comment)
    jdufresne committed Nov 25, 2021
    Copy the full SHA
    8924a65 View commit details

Commits on Nov 26, 2021

  1. Merge pull request #1858 from jdufresne/black-profile

    Remove redundant `multi_line_output = 3` from "Compatibility with black"
    timothycrosley authored Nov 26, 2021
    Copy the full SHA
    54d9c9b View commit details

Commits on Dec 1, 2021

  1. Copy the full SHA
    8c3f257 View commit details

Commits on Dec 4, 2021

  1. Merge pull request #1861 from legau/linesbef

    Fix lines_before_imports appending lines after comments
    timothycrosley authored Dec 4, 2021
    Copy the full SHA
    4e23fcf View commit details
  2. Copy the full SHA
    3cac920 View commit details

Commits on Dec 6, 2021

  1. Merge pull request #1863 from parafoxia/task/issue-1862

    Add a command-line flag to sort __all__ re-exports (#1862)
    timothycrosley authored Dec 6, 2021
    Copy the full SHA
    44e3b5d View commit details

Commits on Dec 30, 2021

  1. Copy the full SHA
    2c6be92 View commit details
  2. poetry update

    timothycrosley committed Dec 30, 2021
    Copy the full SHA
    98673ff View commit details

Commits on Jan 5, 2022

  1. Copy the full SHA
    0011fcf View commit details
  2. Copy the full SHA
    56aab5f View commit details

Commits on Jan 7, 2022

  1. Merge pull request #1878 from staticdev/bug/fix-python-requires-cap-40

    Updates hard requirements on pyproject.tomls
    timothycrosley authored Jan 7, 2022
    Copy the full SHA
    c6a4196 View commit details

Commits on Jan 20, 2022

  1. Remove reference to jamescurtin/isort-action

    jamescurtin/isort-action no longer exists
    AndrewLane authored Jan 20, 2022
    Copy the full SHA
    d189ac0 View commit details

Commits on Jan 21, 2022

  1. Bump ipython from 7.16.2 to 7.16.3

    Bumps [ipython](https://github.com/ipython/ipython) from 7.16.2 to 7.16.3.
    - [Release notes](https://github.com/ipython/ipython/releases)
    - [Commits](ipython/ipython@7.16.2...7.16.3)
    
    ---
    updated-dependencies:
    - dependency-name: ipython
      dependency-type: direct:development
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Jan 21, 2022
    Copy the full SHA
    8a9c373 View commit details

Commits on Feb 3, 2022

  1. Fix build-backend values in the example plugins

    The example plugins are declaring a requirement on poetry-core but using
    the "main" poetry build backend.  Correct them to use the poetry.core
    backend.
    mgorny committed Feb 3, 2022
    Copy the full SHA
    38a4989 View commit details

Commits on Feb 12, 2022

  1. Document shared profiles

    These were added with 2d76984, with
    tests and an example added with
    57eb70a. Add some documentation on how
    these can be created, including a link to the example profile in this
    repo.
    
    Add a link to these docs from where shared profiles are mentioned for
    the `profile` config
    matthewhughes934 committed Feb 12, 2022
    Copy the full SHA
    9b54eba View commit details

Commits on Feb 14, 2022

  1. Copy the full SHA
    e168069 View commit details
  2. Copy the full SHA
    ffe6d76 View commit details

Commits on Feb 19, 2022

  1. fix too-long line

    bmalehorn authored Feb 19, 2022
    Copy the full SHA
    1e22ced View commit details

Commits on Mar 12, 2022

  1. Add magic trailing comma option

    legau committed Mar 12, 2022
    Copy the full SHA
    8cde8b2 View commit details
  2. Copy the full SHA
    58685a4 View commit details

Commits on Apr 13, 2022

  1. Copy the full SHA
    bcfb022 View commit details
  2. Copy the full SHA
    a4f8fb6 View commit details

Commits on May 3, 2022

  1. Copy the full SHA
    0ac4fe1 View commit details
Showing with 3,172 additions and 2,092 deletions.
  1. +66 −0 .github/labels.yml
  2. +31 −0 .github/release-drafter.yml
  3. +3 −0 .github/workflows/constraints.txt
  4. +12 −5 .github/workflows/integration.yml
  5. +18 −0 .github/workflows/labeler.yml
  6. +1 −1 .github/workflows/lint.yml
  7. +15 −0 .github/workflows/release-drafter.yml
  8. +13 −6 .github/workflows/test.yml
  9. +2 −0 .gitignore
  10. +0 −1 .pre-commit-hooks.yaml
  11. +26 −0 CHANGELOG.md
  12. +0 −4 MANIFEST.in
  13. +1 −1 README.md
  14. +2 −4 docs/configuration/black_compatibility.md
  15. +29 −0 docs/configuration/config_files.md
  16. +1 −1 docs/configuration/github_action.md
  17. +583 −84 docs/configuration/options.md
  18. +1 −0 docs/configuration/profiles.md
  19. +1 −1 docs/contributing/1.-contributing-guide.md
  20. +7 −0 docs/contributing/4.-acknowledgements.md
  21. +18 −0 docs/howto/shared_profiles.md
  22. +2 −2 docs/quick_start/0.-try.md
  23. +179 −128 example_isort_formatting_plugin/poetry.lock
  24. +6 −6 example_isort_formatting_plugin/pyproject.toml
  25. +11 −11 example_isort_sorting_plugin/poetry.lock
  26. +5 −5 example_isort_sorting_plugin/pyproject.toml
  27. +4 −4 example_shared_isort_profile/pyproject.toml
  28. +1 −1 isort/_vendored/tomli/_re.py
  29. +36 −3 isort/core.py
  30. +1 −1 isort/format.py
  31. +1 −1 isort/io.py
  32. +14 −2 isort/main.py
  33. +20 −6 isort/output.py
  34. +8 −1 isort/parse.py
  35. +8 −6 isort/profiles.py
  36. +35 −23 isort/settings.py
  37. +1 −1 isort/sorting.py
  38. +1 −0 isort/stdlibs/py310.py
  39. +222 −0 isort/stdlibs/py311.py
  40. +13 −6 isort/wrap.py
  41. +1,045 −1,513 poetry.lock
  42. +23 −23 pyproject.toml
  43. +224 −8 scripts/build_config_option_docs.py
  44. +1 −1 scripts/docker.sh
  45. +4 −3 scripts/lint.sh
  46. +1 −1 scripts/mkstdlibs.py
  47. +4 −3 scripts/test.sh
  48. +13 −0 tests/integration/test_literal.py
  49. +37 −15 tests/integration/test_projects_using_isort.py
  50. +2 −2 tests/integration/test_setting_combinations.py
  51. +188 −0 tests/integration/test_ticketed_features.py
  52. +85 −6 tests/unit/profiles/test_black.py
  53. +141 −13 tests/unit/test_isort.py
  54. +0 −9 tests/unit/test_literal.py
  55. +2 −1 tests/unit/test_parse.py
  56. +1 −179 tests/unit/test_ticketed_features.py
  57. +3 −0 tests/unit/test_wrap.py
66 changes: 66 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
# Labels names are important as they are used by Release Drafter to decide
# regarding where to record them in changelog or if to skip them.
#
# The repository labels will be automatically configured using this file and
# the GitHub Action https://github.com/marketplace/actions/github-labeler.
- name: breaking
description: Breaking Changes
color: "bfd4f2"
- name: bug
description: Something isn't working
color: "d73a4a"
- name: build
description: Build System and Dependencies
color: "bfdadc"
- name: ci
description: Continuous Integration
color: "4a97d6"
- name: dependencies
description: Pull requests that update a dependency file
color: "0366d6"
- name: documentation
description: Improvements or additions to documentation
color: "0075ca"
- name: duplicate
description: This issue or pull request already exists
color: "cfd3d7"
- name: enhancement
description: New feature or request
color: "a2eeef"
- name: github_actions
description: Pull requests that update Github_actions code
color: "000000"
- name: good first issue
description: Good for newcomers
color: "7057ff"
- name: help wanted
description: Extra attention is needed
color: "008672"
- name: invalid
description: This doesn't seem right
color: "e4e669"
- name: performance
description: Performance
color: "016175"
- name: python
description: Pull requests that update Python code
color: "2b67c6"
- name: question
description: Further information is requested
color: "d876e3"
- name: refactoring
description: Refactoring
color: "ef67c4"
- name: removal
description: Removals and Deprecations
color: "9ae7ea"
- name: style
description: Style
color: "c120e5"
- name: testing
description: Testing
color: "b1fc6f"
- name: wontfix
description: This will not be worked on
color: "ffffff"
31 changes: 31 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
categories:
- title: ":boom: Breaking Changes"
label: "breaking"
- title: ":rocket: Features"
label: "enhancement"
- title: ":fire: Removals and Deprecations"
label: "removal"
- title: ":beetle: Fixes"
label: "bug"
- title: ":raising_hand: Help wanted"
label: "help wanted"
- title: ":racehorse: Performance"
label: "performance"
- title: ":rotating_light: Testing"
label: "testing"
- title: ":construction_worker: Continuous Integration"
label: "ci"
- title: ":books: Documentation"
label: "documentation"
- title: ":hammer: Refactoring"
label: "refactoring"
- title: ":lipstick: Style"
label: "style"
- title: ":package: Dependencies"
labels:
- "dependencies"
- "build"
template: |
## Changes
$CHANGES
3 changes: 3 additions & 0 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pip==22.3.1
poetry==1.3.1
virtualenv==20.17.1
17 changes: 12 additions & 5 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
python-version: ["3.9"]

steps:
- uses: actions/checkout@v2
@@ -25,11 +25,18 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade poetry
poetry install
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
poetry --version
- name: Install dependencies
run: poetry install

- name: Test integration
run: ./scripts/test_integration.sh
18 changes: 18 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Labeler

on:
push:
branches:
- main

jobs:
labeler:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Run Labeler
uses: crazy-max/ghaction-github-labeler@v4
with:
skip-delete: true
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
python-version: ["3.9"]

steps:
- uses: actions/checkout@v2
15 changes: 15 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Release Drafter

"on":
push:
branches:
- main

jobs:
draft_release:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 13 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -8,8 +8,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, ubuntu-18.04, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v2
@@ -48,19 +48,26 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
python -m pip install --upgrade poetry
poetry --version
poetry install
- name: Install dependencies
run: poetry install

- name: Test
shell: bash
run: |
poetry run pytest tests/unit/ -s --cov=isort/ --cov-report=term-missing ${@-}
poetry run coverage xml
run: ./scripts/test.sh

- name: Report Coverage
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
uses: codecov/codecov-action@v1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ npm-debug.log
# Unit test / coverage reports
.coverage
.coverage.*
coverage.xml
.pytest_cache
.tox
nosetests.xml
@@ -68,6 +69,7 @@ atlassian-ide-plugin.xml
pip-selfcheck.json

# Python3 Venv Files
.python-version
.venv/
pyvenv.cfg

1 change: 0 additions & 1 deletion .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@
entry: isort
require_serial: true
language: python
language_version: python3
types_or: [cython, pyi, python]
args: ['--filter-files']
minimum_pre_commit_version: '2.9.2'
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,32 @@ Changelog
NOTE: isort follows the [semver](https://semver.org/) versioning standard.
Find out more about isort's release policy [here](https://pycqa.github.io/isort/docs/major_releases/release_policy).

### 5.11.0 December 12 2022

- Added official support for Python 3.11 (#1996, #2008, #2011) @staticdev
- Dropped support for Python 3.6 (#2019) @barrelful
- Fixed problematic tests (#2021, #2022) @staticdev
- Fixed #1960: Rich compatibility (#1961) @ofek
- Fixed #1945, #1986: Python 4.0 upper bound dependency resolving issues @staticdev
- Fixed Pyodide CDN URL (#1991) @andersk
- Docs: clarify description of use_parentheses (#1941) @mgedmin
- Fixed #1976: `black` compatibility for `.pyi` files @XuehaiPan
- Implemented #1683: magic trailing comma option (#1876) @legau
- Add missing space in unrecoverable exception message (#1933) @andersk
- Fixed #1895: skip-gitignore: use allow list, not deny list @bmalehorn
- Fixed #1917: infinite loop for unmatched parenthesis (#1919) @anirudnits
- Docs: shared profiles (#1896) @matthewhughes934
- Fixed build-backend values in the example plugins (#1892) @mgorny
- Remove reference to jamescurtin/isort-action (#1885) @AndrewLane
- Split long cython import lines (#1931) @davidcollins001
- Update plone profile: copy of `black`, plus three settings. (#1926) @mauritsvanrees
- Fixed #1815, #1862: Add a command-line flag to sort all re-exports (#1863) @parafoxia
- Fixed #1854: `lines_before_imports` appending lines after comments (#1861) @legau
- Remove redundant `multi_line_output = 3` from "Compatibility with black" (#1858) @jdufresne
- Add tox config example (#1856) @umonaca
- Docs: add examples for frozenset and tuple settings (#1822) @sgaist
- Docs: add multiple config documentation (#1850) @anirudnits

### 5.10.1 November 8 2021
- Fixed #1819: Occasional inconsistency with multiple src paths.
- Fixed #1840: skip_file ignored when on the first docstring line
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ isort is a Python utility / library to sort imports alphabetically, and
automatically separated into sections and by type. It provides a command line
utility, Python library and [plugins for various
editors](https://github.com/pycqa/isort/wiki/isort-Plugins) to
quickly sort all your imports. It requires Python 3.6+ to run but
quickly sort all your imports. It requires Python 3.7+ to run but
supports formatting Python 2 code too.

- [Try isort now from your browser!](https://pycqa.github.io/isort/docs/quick_start/0.-try.html)
6 changes: 2 additions & 4 deletions docs/configuration/black_compatibility.md
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@ For instance, your _pyproject.toml_ file would look something like
```ini
[tool.isort]
profile = "black"
multi_line_output = 3
```

Read More about supported [config files](https://pycqa.github.io/isort/docs/configuration/config_files.html).
@@ -34,9 +33,9 @@ A demo of how this would look like in your _.travis.yml_
```yaml
language: python
python:
- "3.6"
- "3.7"
- "3.9"
- "3.8"
- "3.7"

install:
- pip install -r requirements-dev.txt
@@ -64,4 +63,3 @@ You can also set the profile directly when integrating isort within pre-commit.
- id: isort
args: ["--profile", "black", "--filter-files"]
```
29 changes: 29 additions & 0 deletions docs/configuration/config_files.md
Original file line number Diff line number Diff line change
@@ -61,6 +61,8 @@ Because isort verification is commonly ran as a testing step, some prefer to pla

```ini
[isort]
profile = black
multi_line_output = 3
```

## .editorconfig
@@ -87,3 +89,30 @@ This can be useful, for instance, if you want to have one configuration for `.py
!!! tip
Custom config files should place their configuration options inside an `[isort]` section and never a generic `[settings]` section. This is because isort can't know for sure
how other tools are utilizing the config file.


## Supporting multiple config files in single isort run

If you have a directory structure where different sub-directories may have their separate configuration settings and you want isort to respect these configurations, not just apply the same global configuration for the entire directory then you can do so with the `--resolve-all-configs` flag. Using the `--resolve-all-configs` along with providing the directory root as `--config-root` argument(if the config-root is not explicitly defined, then isort will consider the current directory `.` where the shell is running), isort will traverse and parse all the config files defined under the `--config-root` and dynamically decide what configurations should be applied to a specific file by choosing the nearest config file in the file's path. For instance, if your directory structure is

```
directory_root
subdir1
.isort.cfg
file1.py
subdir2
pyproject.toml
file2.py
subdir3
file3.py
setup.cfg
```

isort will sort `subdir1/file1` according to the configurations defined in `subdir1/.isort.cfg`, `subdir2/file2` with configurations from `subdir2/pyproject.toml` and `subdir3/file3.py` based on the `setup.cfg` settings.

!!! tip
You can always confirm exactly what config file was used for a file by running isort with the `--verbose` flag.
2 changes: 1 addition & 1 deletion docs/configuration/github_action.md
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: jamescurtin/isort-action@master
- uses: isort/isort-action@master
with:
requirementsFiles: "requirements.txt requirements-test.txt"
```
Loading