Skip to content

Convert relative imports to absolute imports#198

Open
tmikuska wants to merge 1 commit intodevfrom
prefer-absolute-import
Open

Convert relative imports to absolute imports#198
tmikuska wants to merge 1 commit intodevfrom
prefer-absolute-import

Conversation

@tmikuska
Copy link
Collaborator

@tmikuska tmikuska commented Mar 7, 2026

Replace all relative imports (from . / from ..) with absolute imports (from virl2_client.) across the non-test codebase for consistency.

Replace all relative imports (from . / from ..) with absolute imports
(from virl2_client.) across the non-test codebase for consistency.
@tmikuska tmikuska requested review from BregaladTaran, marpauli-cisco and virlos and removed request for BregaladTaran March 7, 2026 11:48
@tmikuska
Copy link
Collaborator Author

tmikuska commented Mar 7, 2026

let me know what you think

@virlos
Copy link
Collaborator

virlos commented Mar 8, 2026

not sure what tools suggest this over relative imports. relative imports are a feature, i.e. not having to use the project name everywhere, and make moving packages easier, while also showing that the import is local. so, I find this unnecessary, though I also do not object against changing it.

@tmikuska
Copy link
Collaborator Author

tmikuska commented Mar 9, 2026

not sure what tools suggest this over relative imports. relative imports are a feature, i.e. not having to use the project name everywhere, and make moving packages easier, while also showing that the import is local. so, I find this unnecessary, though I also do not object against changing it.

In the main code base, this is more of an exception in pkgtool and tests, but here relative imports represent 1/3 of imports. I just wanted to hear everyone's opinion before making any change. I prefer absolute imports over relative ones, but I have no strong feelings and the main reason why I raised this this way is the majority of imports are still absolute.

@PatrikMosko
Copy link
Collaborator

I agree with @virlos , relative imports have their place and there's no reason to enforce consistency on this front.

It might make sense to remove certain relative imports especially the ".."-ones, but not all... also, there's a good chance the "virl2_client" will become "cml2_client" or something, you know where I am going with this

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.

3 participants