Comments (15)
Agreed! Will fix this prior to next release, Thanks!
from isort.
Closing as I fixed this upstream in pies2 (modules that are already present python2.7 are no longer installed)
from isort.
A future reference for Python 2.7 users: isort breaks pyflakes. It somehow installs enum32
and ipaddress
along with several other packages. (I'm not sure why there needs to be so many dependencies for a simple utility.) One of them breaks pyflakes with the following error.
AttributeError: 'ClassDef' object has no attribute 'keywords'
from isort.
@myint Those packages are installed with Pies: A python 3 and 2 compatibility layer. Because of the way it works, by definition if you only have one app that uses it, there will be more then necessary. However, nothing in pies uses any crazy hacks that would apply outside of programs that import it, and for the most part simply provides backported modules - that again should have no affect unless directly imported.
On my own box I did indeed encounter this issue - but it seemed for me to be an issue with pyflakes itself, it happened even after I uninstalled pies + isort (ran pip freeze to verify) and even when runnning pylakes in its own virtualenv.
In any case, I think this should be reported to the pyflakes project directly, and as a work around if it is indeed isort - you can run isort in a virtualenv so any included modules don't affect your main project installation.
from isort.
I isolated the cause to pies2overrides.
from isort.
Found the root cause:
https://github.com/pyflakes/pyflakes/blob/master/pyflakes/checker.py#L10
That's a very non-standard way to determine the version of python, especially when theres a direct api call to get the major version... will create a pull request against pyflakes
from isort.
https://github.com/timothycrosley/pyflakes/compare/pyflakes:master...patch-1?quick_pull=1
from isort.
Right. The maintainer of pyflakes seems to be taking some time off. I haven't seen any activity in a while.
I committed a workaround for my personal use that removes use of all external dependencies (myint-archive/isort@ea01d52).
from isort.
@timothycrosley Thanks for the pointer in your comment. PyCQA/pyflakes@72263b4 was merged so there's a light at the end of this tunnel but there hasn't been a PyPI release yet.
from isort.
@acdha, there is now also an alternative with the fix released to pypi: https://github.com/timothycrosley/frosted
from isort.
Speaking of which, @myint - any interest in creating an autofrosted? If you do I will enthusiastically link to it from the frosted repository :)
from isort.
@timothycrosley I saw that – has anyone created a frosted flake8 fork yet?
from isort.
@acdha, not yet - but frosted has only been live for 4 days so my hopes are high - may start one myself if someone doesn't step up to the plate, or contribute if someone does (the preferable option).
from isort.
I got my patches into pyflakes and Florent added full Python 3.4 support. So I'm happy with pyflakes.
from isort.
@myint that's fair enough, I will probably try to integrate it myself in some fashion, if it is alright with you. In any case any insights or pull requests from you or Florent will continue to be appreciated and accepted.
from isort.
Related Issues (20)
- isort doesn't format the imports in PyCharm's Jupyter notebooks
- False order of local imports relative to standard library imports
- Circular Import Issue Due to Import Reordering in Python 3.8
- Bug : isort add empty lines before pylint comments
- Deprecate `setuptools` integration comand
- Docs: GitHub action and Pre-commit need better configuration/args examples HOT 1
- Bug: Word wrapping works incorrectly with force_single_line=True
- isort breaks the code with sort_reexports = true HOT 2
- noqa isn't well respected
- Feature request: per-block sorting strategy (inline sort)
- Isort does not honor skip directories
- `isort` does not move all imports to the top of the file when there are imports after other code blocks
- `--sort-reexports` does not respect `--profile=black` HOT 2
- isort --profile black produces long lines HOT 8
- isort copies comments across imports HOT 4
- Feature request: Remove superfluous `import a` statements when there is already `import a.b`
- --sort-reexports results in isort not being able to parse file
- OSS Fuzz Integration
- Unrecoverable exception thrown when parsing when parsing a module
- Long imports and noqa
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from isort.