Closed zliang-akamai closed 3 months ago
@zliang-akamai This PR looks great!
I do have one concern: given this is a package intended to be consumed by users would this accidentally break any indirect imports? Most of the dropped imports seem pretty insignificant but it might be worth double-checking just in case 🙂
@lgarber-akamai Thanks for the reminder!
I think all imports it removed is not relevant to the module it's in.
For example, from linode_api4.objects.profile import PersonalAccessToken
is removed in linode_api4/groups/account.py
.
The right way to import PersonalAccessToken
is from linode_api4.objects.profile import PersonalAccessToken
rather than something like from linode_api4.groups.account import PersonalAccessToken
.
I doubt there is any indirect import like that, and even that's the case, they can easily fix it by changing the import path.
Autoflake would ignore (not to remove) any unused import in __init__.py
, so the importing from a module won't be impacted. For example, from linode_api4 import DomainRecord
is not impacted, and you don't have to import it via absolute path, like from linode_api4.objects.domain import DomainRecord
.
But we can definitely mark it as a breaking change as a head up to the users.
@lgarber-akamai Thanks for the reminder!
I think all imports it removed is not relevant to the module it's in.
For example,
from linode_api4.objects.profile import PersonalAccessToken
is removed inlinode_api4/groups/account.py
.The right way to import
PersonalAccessToken
isfrom linode_api4.objects.profile import PersonalAccessToken
rather than something likefrom linode_api4.groups.account import PersonalAccessToken
.I doubt there is any indirect import like that, and even that's the case, they can easily fix it by changing the import path.
Autoflake would ignore (not to remove) any unused import in
__init__.py
, so the importing from a module won't be impacted. For example,from linode_api4 import DomainRecord
is not impacted, and you don't have to import it via absolute path, likefrom linode_api4.objects.domain import DomainRecord
.But we can definitely mark it as a breaking change as a head up to the users.
Sounds good to me! I think this is a very positive change, we just need to make sure we communicate it well 👍
📝 Description
To cleanup unused imports
✔️ How to Test