Skip to main content
https://travis-ci.org/gforcada/flake8-isort.svg?branch=master https://coveralls.io/repos/gforcada/flake8-isort/badge.svg?branch=master&service=github

Flake9 meet isort

Fork of flake8-isort that depends on flake9 for pyproject.toml support. Everything else is the same.

Use isort to check if the imports on your python files are sorted the way you expect.

Add an .isort.cfg to define how you want your imports sorted and run flake8 as you usually do.

See isort documentation for .isort.cfg available options.

Install

Install with pip:

$ pip install flake9-isort

Install with conda:

$ conda install -c conda-forge flake9-isort

Configuration

If using the select [option from flake8](http://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-select) be sure to enable the I category as well, see below for the specific error codes reported by flake8-isort.

Error codes

Error code

Description

I001

isort found an import in the wrong position

I002

no configuration found (.isort.cfg or [isort] in configs)

I003

isort expected 1 blank line in imports, found 0

I004

isort found an unexpected blank line in imports

I005

isort found an unexpected missing import

Requirements

  • Python 2.7, 3.5, 3.6, pypy or pypy3

  • flake9

  • isort

Relation to flake8-import-order

As an alternative to this flake8 plugin, there’s flake8-import-order that could be worth checking out. In contrast to this plugin that defers all logic to isort, the flake8-import-order comes bundled with it’s own logic.

flake8-import-order comes with a few predefined set of styles meanwhile this plugin can be customized a bit more. But the biggest difference could lie in that flake8-isort actually has the corresponding sorting engine isort that can sort the import orders of your existing python files. Meanwhile flake8-import-order has no such corresponding tool, hence big existing projects who want to adopt either would get a more automized experience choosing flake8-isort.

License

GPL 2.0

Changelog

4.0.2 (2020-10-24)

  • change dependency from flake8 to flake9

4.0.0 (2020-08-11)

  • Nothing changed yet.

4.0.0a0 (2020-08-07)

  • support isort >= 5 [bnavigator, pkolbus]

3.0.1 (2020-07-08)

  • Work around FailedToLoadPlugin exception by requiring isort 4.x. Likewise, pin the major version of all dependencies, to reduce risk of any future incompatibilities. [pkolbus]

3.0.0 (2020-04-15)

  • Let isort search the configuration, rather than flake8-isort try to find it. [jnns]

2.9.1 (2020-03-28)

  • Fix flake8 warning. [sobolevn]

2.9.0 (2020-03-16)

  • Add python3.8 suport. [sobolevn]

2.8.0 (2019-12-05)

  • Look for isort configuration on .flake8 files as well. [JohnHBrock]

  • Document how to install flake8-isort on conda. [marcelotrevisani]

  • Look for isort configuration on pyproject.toml files as well. [sanjioh]

2.7.0 (2019-03-19)

  • Improve the README. [barbossa]

  • Fix isort output when pipes are used. [maerteijn]

2.6.0 (2018-12-01)

  • Use pytest to run tests. [gforcada]

  • New error code I005 isort foundan unexpected missing import. [charettes]

  • Add isort_show_traceback option to show verbose multi-line output from isort, turned off by default [sobolevn]

2.5 (2018-03-15)

  • Now requires isort >= 4.3.0. [jleclanche]

2.4 (2018-02-25)

  • Fix input handling with flake8’s –stdin-display-name, and simplify it. [blueyed]

  • Remove flake8-polyfill dependency. flake8 >= 3.2.1 is required already, and stdin is not read directly anymore. [blueyed]

2.3 (2017-12-22)

  • Fix typo. [paltman]

  • Add tox.ini and .editorconfig to config search. [cas–]

  • Make this plugin compatible with flake8 hook. As the hook copies the files out of tree, flake8-isort never finds the correct configuration. [jaysonsantos]

2.2.2 (2017-08-19)

  • Workaround for isort bug when skipping files. [danpalmer]

2.2.1 (2017-05-12)

  • Release as universal wheel. [gforcada]

2.2 (2017-03-26)

  • Support flake8 git hook. [sergio-alonso]

  • Support python 3.6. [gforcada]

  • Search configuration on home folder. [gforcada]

2.1.3 (2016-11-25)

  • Fix yet another corner case. [gforcada]

2.1.2 (2016-11-25)

  • Fix another corner case: ignored files. [cas–]

2.1.1 (2016-11-25)

  • Fix corner cases of isort: newlines and grouped imports. [cas–]

2.1.0 (2016-11-24)

  • Show the exact line and kind of error, rather than a generic message. [cas–]

2.0.3 (2016-11-22)

  • Update trove classifiers. [gforcada]

2.0.2 (2016-11-22)

  • Add flake8 classifier. [sigmavirus24]

  • Require flake8 3.2.1. flake8 series 3.1.x and 3.2.0 where not reporting flake8-isort errors. [gforcada]

  • Test on pypy and pypy3. [gforcada]

  • Fix tests and formatting. [gforcada]

2.0.1 (2016-09-22)

  • Fix standard input processing. [carljm]

2.0 (2016-09-14)

  • Refactor code to handle flake8 version 3. [danpalmer]

  • Require flake8 version 3.0. [gforcada]

1.3 (2016-06-20)

  • Make error messages clearer. [do3cc]

  • Use either pep8 or pycodestyle (new name for pep8). [Maxim Novikov]

  • Fix coveralls. [gforcada]

1.2 (2016-03-05)

  • Allow stdin processing, this way text editor can pass input to flake8. [mjacksonw]

1.1.1 (2016-02-16)

  • Silence isort messages. [gforcada]

  • Improve wording. [gforcada]

1.1 (2016-02-16)

  • Check for isort configuration on setup.cfg as well. [plumdog]

1.0 (2015-12-16)

  • Check for an isort configuration file. [gforcada]

0.2 (2015-09-14)

  • Fix entry point. [gforcada]

0.1.post0 (2015-09-13)

  • Release wheels as well. [gforcada]

0.1 (2015-09-13)

  • Initial release [gforcada]

  • Add all boilerplate files. [gforcada]

  • Create the flake8 plugin per se. [gforcada]

Metadata

Release files for flake9-isort 4.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake9-isort 4.0.2
File Size Uploaded Provenance Actions
flake9-isort-4.0.2.tar.gz 17.8 kB Without provenance Details for flake9-isort-4.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flake9-isort 4.0.2
File Interpreter ABI Platform Actions
flake9_isort-4.0.2-py2.py3-none-any.whl Python 3, Python 2 none any Details for flake9_isort-4.0.2-py2.py3-none-any.whl

Total release size: 32.4 kB

Release files / flake9-isort-4.0.2.tar.gz

Download URL flake9-isort-4.0.2.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
790221b0966f0c8d8b611ff2612112099f45a9819586f7c82bf565d6ca11e0d0
BLAKE2b-256 checksum
How to use checksums
0ea152e312e6f3332bf73f73d009ebd563fead725796dd37da39e2294d86835d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

Release files / flake9_isort-4.0.2-py2.py3-none-any.whl

Download URL flake9_isort-4.0.2-py2.py3-none-any.whl
Size 14.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
b2d8aa3b829bef844c594a1f4e280e10f44d9dd57e9201e427e6513defbb4e01
BLAKE2b-256 checksum
How to use checksums
ac315eb78bf7b0693dffe8ce42a22c489652d3cecb67d383d2112fc1428d8f06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

Security for flake9-isort 4.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

4.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page