mbedtls icon indicating copy to clipboard operation
mbedtls copied to clipboard

[DO NOT MERGE] Reference commit for package aliasing

Open minosgalanakis opened this issue 10 months ago • 0 comments

Description

Simple showcase of how to create an aliased version of a package in python by overriding the __all__ attribute of the module loader.

Unfortunately we cannot re-use the same name and if we would like to contain python files in multiple locations and expose them as a single pacakge we should consider namespace packages

I think it is considerably more complicated, then just using the proposed trick with all imports.

In a script in the main codebase you can do from mbedtls_dev import * while in the test codebase you could do from mbedtls_test_dev import * and would still expose the modules directly bignum_common so the code won't have to change.

This PR is not to be merged just for discussion purposes.

minosgalanakis avatar Apr 25 '24 17:04 minosgalanakis