Skip to content

🪲 BUG-#208: Replace spec_from_file_location with importlib.import_module#229

Merged
FernandoCelmer merged 1 commit intodevelopfrom
feature/208
Apr 9, 2026
Merged

🪲 BUG-#208: Replace spec_from_file_location with importlib.import_module#229
FernandoCelmer merged 1 commit intodevelopfrom
feature/208

Conversation

@FernandoCelmer
Copy link
Copy Markdown
Member

Description

Replace manual filesystem-based module loading with importlib.import_module() in the Module class.

Issue: 📌 ISSUE-#208

Changes

  • Replace spec_from_file_location + module_from_spec + sys.modules with importlib.import_module()
  • Remove _get_path and _get_name helper methods
  • Use str.rpartition(".") to split module path from attribute name
  • Works with installed packages, namespace packages, zip imports, any CWD

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@FernandoCelmer FernandoCelmer added the bug Something isn't working label Apr 9, 2026
@FernandoCelmer FernandoCelmer merged commit 94e6b3a into develop Apr 9, 2026
10 checks passed
@FernandoCelmer FernandoCelmer deleted the feature/208 branch April 9, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant