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

group_by_package errors when packages start with import #2135

Open
glasnt opened this issue May 19, 2023 · 1 comment · May be fixed by #2136
Open

group_by_package errors when packages start with import #2135

glasnt opened this issue May 19, 2023 · 1 comment · May be fixed by #2136

Comments

@glasnt
Copy link

glasnt commented May 19, 2023

group_by_package is a configuration only used by the google profile, but it introduces a pathway in section_key where from imports are further filtered.

The current tokenization logic for this works for most cases, except where the imported module starts with import.

Failure case: applying isort --profile google yielded the following diff:

--- a/kms/snippets/snippets_test.py
+++ b/kms/snippets/snippets_test.py
 from encrypt_symmetric import encrypt_symmetric
+from import_manually_wrapped_key import import_manually_wrapped_key
 from generate_random_bytes import generate_random_bytes
 from get_key_labels import get_key_labels
 from get_key_version_attestation import get_key_version_attestation
@@ -65,7 +67,6 @@ from get_public_key_jwk import get_public_key_jwk
 from iam_add_member import iam_add_member
 from iam_get_policy import iam_get_policy
 from iam_remove_member import iam_remove_member
-from import_manually_wrapped_key import import_manually_wrapped_key
 from quickstart import quickstart

The import of import_manually_wrapped_key was erroneously moved.

Patch and tests incoming.

@glasnt
Copy link
Author

glasnt commented May 19, 2023

glasnt added a commit to glasnt/isort that referenced this issue May 19, 2023
@glasnt glasnt linked a pull request May 19, 2023 that will close this issue
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 a pull request may close this issue.

1 participant