-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Change isort config and turn on isort in CI #4288
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
Comments
The two options I can see are:
I'm in favour of explicitly marking those as "standard library". |
JelleZijlstra
added a commit
to JelleZijlstra/typeshed
that referenced
this issue
Jun 29, 2020
Fixes python#4288. - Default imports to THIRD_PARTY, so in effect we merge the FIRST_PARTY and THIRD_PARTY stubs. This means import order is no longer affected by whether typing_extensions is installed locally. - Treat typing_extensions and _typeshed as standard library modules. Note that isort master is very different from the latest release; we'll have to do something different if and when the next isort release comes out.
Merged
hauntsaninja
pushed a commit
that referenced
this issue
Jun 29, 2020
Fixes #4288. - Default imports to THIRD_PARTY, so in effect we merge the FIRST_PARTY and THIRD_PARTY stubs. This means import order is no longer affected by whether typing_extensions is installed locally. - Treat typing_extensions, _typeshed and some others as standard library modules. Note that isort master is very different from the latest release; we'll have to do something different if and when the next isort release comes out.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While trying to land isort in CI in #3329, I discovered that the behavior of our current isort config depends on whether some modules (e.g.,
typing_extensions
) are installed in the runtime environment where isort is run. This is bad because it means that contributors running isort locally may get different behavior depending on what libraries they happen to have installed in their local environment.I'm guessing that this has to do with isort's behavior of sorting imports into "sections" of standard library, third-party, and first-party imports. Looking at https://github.com/timothycrosley/isort/wiki/isort-Settings, maybe we need to set
default_section
? Perhaps we should also mark typing-extensions and _typeshed as "standard library" because in the context of typeshed, they essentially are part of the standard library.The text was updated successfully, but these errors were encountered: