Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Aug 20 15:00
    mikelane commented #1001
  • Aug 20 12:04
    Zarathustra2 commented #1001
  • Aug 20 11:39
    codecov-io commented #998
  • Aug 20 11:39
    jdufresne synchronize #998
  • Aug 19 23:09
    mikelane opened #1001
  • Aug 19 17:56
    codecov-io commented #1000
  • Aug 19 17:49
    FuegoFro synchronize #1000
  • Aug 19 17:40
    FuegoFro synchronize #1000
  • Aug 18 18:22
    FuegoFro synchronize #1000
  • Aug 18 17:54
    codecov-io commented #1000
  • Aug 18 17:49
    FuegoFro opened #1000
  • Aug 17 18:39
    jdufresne opened #999
  • Aug 17 18:19
    jdufresne synchronize #995
  • Aug 17 18:19
    jdufresne opened #998
  • Aug 17 18:02
    jdufresne synchronize #995
  • Aug 17 18:01
    jdufresne synchronize #992
  • Aug 17 17:57
    codecov-io commented #992
  • Aug 17 17:52
    jdufresne synchronize #992
  • Aug 17 17:23
    codecov-io commented #995
  • Aug 17 17:18
    jdufresne synchronize #995
Timothy Edmund Crosley
doing isort --dont-order-by-type will sort only alphabetically like I presume you are expecting
or setting order_by_type to False within your config
@timothycrosley thanks for the clarification
yes I was expecting it to sort alphabetically
but it all makes sense now - appreciate the help
Timothy Edmund Crosley
glad to clear things up! :) Feel free to let me know if you have any other questions
Krzysztof Nowak
Hey, I guess one of the recent releases now forbids two line import like:
    from very.long.path import \
which, when enforced to be a one line, violates some other pep checkers for 80 char line
actually I haven't check if it's possible to disable it (will do so now)
but I guess that might raise a lot issues for some projects
Krzysztof Nowak
I can't seem to find an option to disable this
Krzysztof Nowak
Should I create an Issue on GitHub ?
Timothy Edmund Crosley
I can't reproduce
Tried the following from very.long.path import an_even_longer_function_name_that_is_actually_over_80_characters
and ran isort -w 80 long_line.py
and it was turned into:
from very.long.path import \
are you setting the line length limit to 80? What are your settings?
Krzysztof Nowak

length limit is 79 in our case, but what I actually found to be the option what causes this is:


in .editorconfig

Krzysztof Nowak
When I remove the .editorconfig I don't get sorting errors
Timothy Edmund Crosley
@krzysztof Thanks! The additional info should help me reproduce, when I have sometime later today I'll try to reproduce, if I can I believe it's almost certainly a regression
Timothy Edmund Crosley
@krzysztof I've been able to reproduce and fix this issue, and I've pushed out a hotfix release with this fixed: 4.2.15
Krzysztof Nowak
@timothycrosley Thanks! :) I'll check it out
I can confirm that our project passes isort check correctly now :+1:
Timothy Edmund Crosley
Glad it works now :)
Sylvain Boily
pip install --upgrade pylint
Collecting pylint
  Downloading pylint-1.8.2-py2.py3-none-any.whl (689kB)
    100% |################################| 696kB 1.4MB/s 
Collecting astroid<2.0,>=1.6 (from pylint)
  Downloading astroid-1.6.1-py2.py3-none-any.whl (288kB)
    100% |################################| 296kB 2.5MB/s 
Collecting singledispatch; python_version < "3.4" (from pylint)
  Downloading singledispatch-
Collecting isort>=4.2.5 (from pylint)
  Downloading isort-4.3.0.tar.gz (54kB)
    100% |################################| 61kB 5.9MB/s 
    Complete output from command python setup.py egg_info:
    /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
    error in isort setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
trying to understand why sort cannot be installed using pip anymore
Sylvain Boily
found the github issue. 4.3 is dead
Steven M. Vascellaro
In isort 4.3.4, import _tkinter is grouped as a third party import. Is this an intended behavior?
import tkinter

import _tkinter
import wfc_helper
For reference: _tkinter is a binary module containing the low-level interface to Tk. (documentation)
Lennart Grahl
Hi everyone! I'm a bit puzzled by some inconsistent (?) behaviour of isort when using order_by_type = true. Someone here willing to take a look? :)
Catherine DeJager
Hello! I'm trying to use Pylint for work, but our Python version is rather outdated - we're using Python 2.6. When I try to install isort using pip, it fails because Python version must be 2.7 or higher. Is there an older version of isort I can use?
Timothy Edmund Crosley
@cmd16_gitlab I would recommend installing isort with a newer Python, independent of the Python required to run your code. You can run isort on 2.7 against 2.6 code without issue.
@/all isort 4.3.5 has been officially released and represents the last release with official support for Python2.x https://github.com/timothycrosley/isort/releases/tag/4.3.5
This message was deleted
iGor milhit
Hi. Very recently, we pinned the isort version to be >=4.3.5, because it changes the import order for relative paths. But yesterday, isort was behaving like it was before version 4.3.5, and I checked, our project was using isort in version 4.3.10... So my question is, which behavior should we expect in the future? Thanks.
Timothy Edmund Crosley
@iGormilhit did this issue ever get fixed for you? isort had a series of hot fix releases, as a result of not being released in over a year
each one came with additional test cases
and it should be in a stable state now
iGor milhit
@timothycrosley Yeah, I think it's ok now. I asked because I was seeing changes, and reverse changes... Thanks for the good work, by the way. :smiley:
Serge Matveenko

Hey! I have a lind of missunderstanding.
I'm using isort on pre commit hook.
isort config:

line_length = 88
multi_line_output = 4
lines_after_imports = 2
skip_glob =

and it works for isort -c -rc
but for pre commit hook migrations/** is being ignored 'cause it passes the file pass explictly like
isort migrations/versions/1234.py and that ignores skip_glob
is there a way to fix or workaround this behavior?
basically, I would like skip_glob to match even if file was provided explicitly using its full path

Timothy Edmund Crosley
@lig, sorry for the long delay getting back to you on this!
I've implemented a solution for your issue in the latest hot fix release: timothycrosley/isort#938
if you add --filter-files to a command line invocation of isort, it will now filter even the files you explicitly pass in
I hope this resolves your issue!
Justin Lee


Quick question.
Trying to run isort on a django app. The output in CI (where app dependencies are not installed) is different then when I run it locally within a virtualenv.

isort -df output (ticketing and root_apps are first party modules)

 from django.contrib.postgres.fields import ArrayField
 from django.db import models
 from rest_framework import status
+from root_app.exceptions import StatusAPIError
 from sequences import get_next_value
-from root_app.exceptions import StatusAPIError
 from ticketing import TicketingErrorMessage
 from ticketing.constants import TICKET_SEQUENCE

Without a venv to point isort to, is there a way to tell isort to see if a module is first party by checking relative import paths?

Justin Lee
I have decided to use seed-isort-config to help with preseeding known third party library.
Would be great to see if isort will tackle this sort of environment dependent errors in the future by deprecating the import check logic
Timothy Edmund Crosley
@justinttl agreed! This is part of the plan for the next major release of isort that is in the works