Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a command-line flag to sort __all__ re-exports (#1862) #1863

Merged
merged 1 commit into from Dec 6, 2021

Conversation

parafoxia
Copy link
Contributor

@parafoxia parafoxia commented Dec 4, 2021

This PR adds a --sort-reexports CLI flag and the respective cfg and toml options to isort, which allows for similar behaviour to # isort: [list|tuple|dict] without the need to have comments scattered around. See #1862 for more information.

This PR makes no attempt to document this feature at present, but I'm happy to do this if you'd like me to.

Closes #1862.

@parafoxia
Copy link
Contributor Author

Also, for some reason, the test_importable test fails when localling running pytest. I'm not really sure why this is, but I haven't attempted a fix as I believe it's outside the scope of this PR, and the failure is likely not caused by it.

@codecov
Copy link

codecov bot commented Dec 5, 2021

Codecov Report

Merging #1863 (3cac920) into main (4e23fcf) will decrease coverage by 0.29%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##             main    #1863      +/-   ##
==========================================
- Coverage   99.83%   99.54%   -0.30%     
==========================================
  Files          38       38              
  Lines        3054     3070      +16     
  Branches      728      730       +2     
==========================================
+ Hits         3049     3056       +7     
- Misses          1        8       +7     
- Partials        4        6       +2     

@timothycrosley
Copy link
Member

Thanks for this improvement! The tests pass in CI and locally for me, so I'm sure its just because of the state of local venv, maybe not using poetry or not using ./scripts/done.sh?

@timothycrosley timothycrosley merged commit 44e3b5d into PyCQA:main Dec 6, 2021
@parafoxia
Copy link
Contributor Author

I was using Poetry, but didn't realise that other script was there, so probably was something to do with that. I did initially try to install everything without Poetry cos I can't for the life of me get it to work on 3.10, but pip wouldn't install everything, so not sure what's going on there.

And no worries! Lib has been super useful to me for a while so thought I'd give a little back ^-^

@parafoxia parafoxia deleted the task/issue-1862 branch December 6, 2021 07:42
@parafoxia parafoxia mentioned this pull request Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A command-line flag to sort __all__ re-exports
2 participants