Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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
@timothycrosley
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
adamhz
@adamhz
@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
@timothycrosley
glad to clear things up! :) Feel free to let me know if you have any other questions
Krzysztof Nowak
@krzysztof
Hey, I guess one of the recent releases now forbids two line import like:
    from very.long.path import \
        an_even_longer_function_name
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
@krzysztof
I can't seem to find an option to disable this
Krzysztof Nowak
@krzysztof
Should I create an Issue on GitHub ?
Timothy Edmund Crosley
@timothycrosley
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 \
    an_even_longer_function_name_that_is_actually_over_80_characters`
are you setting the line length limit to 80? What are your settings?
Krzysztof Nowak
@krzysztof

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

[*.py]
multi_line_output=2

in .editorconfig

Krzysztof Nowak
@krzysztof
When I remove the .editorconfig I don't get sorting errors
Timothy Edmund Crosley
@timothycrosley
@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
@timothycrosley
@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
@krzysztof
@timothycrosley Thanks! :) I'll check it out
I can confirm that our project passes isort check correctly now :+1:
Timothy Edmund Crosley
@timothycrosley
Glad it works now :)
Sylvain Boily
@djsly
Hello
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-3.4.0.3-py2.py3-none-any.whl
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'
      warnings.warn(msg)
    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
@djsly
found the github issue. 4.3 is dead
Steven M. Vascellaro
@stevoisiak
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
@lgrahl
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
@cmd16_gitlab
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
@timothycrosley
@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
@iGormilhit
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
@timothycrosley
@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
@iGormilhit
@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
@lig

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 =
    migrations/**

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
@timothycrosley
@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
@justinttl

Hi!

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
@justinttl
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
@timothycrosley
@justinttl agreed! This is part of the plan for the next major release of isort that is in the works