There is this option
-dt, --dont-order-by-type
Only order imports alphabetically, do not attempt type ordering
but it would be nice to have the opposite: sort by group (stdlib, application, etc.) and nothing else
Hi! if no one is working on this, I would like to work on this issue.
@anirudnits I'm sorry I'm so late to seeing this! If you still would like to work on it, it's now assigned to you.
@timothycrosley no worries :) I am facing some problems with getting the setup done in my WSL(it was fine in pure Ubuntu) and trying to do it via Docker. Will start working on the issue as soon as that's done.
@timothycrosley Hi, I just had a few questions and would appreciate it if you could clear them out.
--only-sections or something like that and another attribute in the config data schemastraight_imports over from_imports hold if not specified otherwise?Hi @anirudnits,
Happy to answer any questions!
should I add a new CLI flag? like --only-sections or something like that and another attribute in the config data schema
Yes, exactly!
would the order of straight_imports over from_imports hold if not specified otherwise?
Yes I think it makes sense for it to hold if not otherwise specified
Thanks!
~Timothy
@timothycrosley Sorry to bother you again. I'm sort of done with the code but when I try to test with docker build ./ -t isort:latest. I get this error:
/isort/isort does not contain any element
The command '/bin/sh -c python -m pip install --upgrade pip && python -m pip install poetry && poetry install' returned a non-zero code: 1
I did the docker setup earlier and I guess this showed up after I ran the git pull upstream develop command. Is this a reproducible error or am I doing something wrong?
Update: I solved the issue by removing the last poetry install in:
https://github.com/PyCQA/isort/blob/ba8cf2f19a3092876bc57fc83dd9557ba461ef07/Dockerfile#L8
I guess poetry install should be executed later on as in:
https://github.com/PyCQA/isort/blob/ba8cf2f19a3092876bc57fc83dd9557ba461ef07/Dockerfile#L11
@anirudnits, never a bother! I think you found a bug in the dockerfile! Your solution should work, with the small caveat that it removes the intended caching so each run will take a bit longer, I've updated the dockerfile in develop to fix the problem you encountered
opened a pull request https://github.com/PyCQA/isort/pull/1455
Closing as this is implemented in develop using a new --only-sections option (huge thanks to @anirudnits!) and will be released to PyPI with the 5.6.0 release.
Thanks!
~Timothy
Most helpful comment
Hi! if no one is working on this, I would like to work on this issue.