Skip to content

Commit

Permalink
Release 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Sep 6, 2013
2 parents f300ec7 + 7e965c3 commit e62dd4b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,8 @@ After isort:
import os
import sys

from third_party import (lib1,
lib2,
lib3,
lib4,
lib5,
lib6,
lib7,
lib8,
lib9,
lib10,
lib11,
lib12,
lib13,
lib14,
lib15)
from third_party import (lib1, lib2, lib3, lib4, lib5, lib6, lib7, lib8,
lib9, lib10, lib11, lib12, lib13, lib14, lib15)

from my_lib import Object, Object2

Expand Down Expand Up @@ -204,6 +191,19 @@ This will result in the following output style:
UnexpectedCodePath,
)

Skip processing of a single import
======================

To make isort ignore a single import simply add a comment at the end of the import line containing the text 'isort:skip'

import module # isort:skip

or

from xyz import (abc, # isort:skip
yo,
hey)

Why isort?
======================

Expand Down
Binary file added dist/isort-1.2.2.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion isort/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
from . import settings
from .isort import SortImports

__version__ = "1.2.1"
__version__ = "1.2.2"
6 changes: 4 additions & 2 deletions isort/isort.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@ def _import_type(line):
""" If the current line is an import line it will
return its type (from or straight)
"""
if line.startswith('import '):
if "isort:skip" in line:
return
elif line.startswith('import '):
return "straight"
if line.startswith('from ') and "import" in line:
elif line.startswith('from ') and "import" in line:
return "from"

def _at_end(self):
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from distutils.core import setup

setup(name='isort',
version='1.2.1',
version='1.2.2',
description='A Python utility / library to sort Python imports.',
author='Timothy Crosley',
author_email='[email protected]',
url='https://github.com/timothycrosley/isort',
download_url='https://github.com/timothycrosley/isort/blob/master'
'/dist/isort-1.2.1.tar.gz?raw=true',
'/dist/isort-1.2.2.tar.gz?raw=true',
license="MIT",
scripts=['scripts/isort'],
packages=['isort'],
Expand Down

0 comments on commit e62dd4b

Please sign in to comment.