Force to top should support *specific* ordering
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7k
- Forks
- 687
- Avg merge
- 4h 56m
- Merged PRs (30d)
- 2
Description
Currently when "force to top" is being used with multiple packages, then it forces all of them to the top but unfortunately does so in an alphabetical manner.
When setting:
force_to_top = ["torch", "tensorflow"]
The result will be:
import tensorflow
import torch
whereas it should be:
import torch
import tensorflow
Currently, it seems that isort does not support the ability to set multiple imports at the top of a section with a user-specified ordering. This is prohibitive because, unfortunately, some python packages have strict order import requirements.
I hope that I'm missing something! Any idea on how to solve this with isort would be much appreciated!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is identified in the issue. Start by searching the isort codebase for the force_to_top setting and its tests, then trace how multiple packages are ordered. Done means a configuration such as ["torch", "tensorflow"] preserves that order in the generated imports, with coverage for the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100