Releases: p1-dta/lazimp
Releases · p1-dta/lazimp
0.0.4
Features
- ⭐ Lazy import of aliases is now supported e.g.
lazimp.lazy_import('numpy', aliases={'np': 'numpy'})
will expose the attributenp
but lazy importsnumpy
. You can see an example here: https://github.com/Vikka/lazimp/tree/main/examples/aliases. - ⭐ Import with path.to.module is now supported e.g.
lazimp.lazy_import('package.submodule')
will exposepackage
but lazy importspackage.submodule
. You can see an example here: https://github.com/Vikka/lazimp/tree/main/examples/bare_sub_import.
Breaking changes
⚠️ lazimp.lazy_import
signature has changed i.e.:
def lazy_import(
*bare_imports: str,
aliases: collections.abc.Mapping[str, str] | None = None,
sub_import: collections.abc.Mapping[str, str] | None = None,
**kw_sub_import: str,
) -> collections.abc.Callable[[str], ModuleType]:
kw_sub_import
will be merge with the sub_import
mapping.
Fixes
- 🐛 Fix bare import who weren't working.
Docs
- ✏️ Example of usage folders: https://github.com/Vikka/lazimp/tree/main/examples.
- ✏️ Update example in README.md: 0.0.3...0.0.4#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
Full Changelog: 0.0.3...0.0.4
PyPi release: https://pypi.org/project/lazimp/0.0.4/
0.0.3
Features
- ⭐ To help typing and auto-completion of packages that use
lazimp
,types.ModuleType
is now accessible throughlazimp
directly.
Docs
- ✏️
README.md
with description and examples.
Full Changelog: 0.0.2...0.0.3
PyPi release: https://pypi.org/project/lazimp/0.0.3/
0.0.2
Fixes
- 🐛 Fix a missing import that prevent the package to be used properly when built from github sources.
- 🐛
main
auto-complete fromlazimp
module is removed.
Internal
- ⚙️
lazy_import
is directly stored in__init__.py
, not inmain.py
anymore.
Full Changelog: 0.0.1...0.0.2
PyPi release: https://pypi.org/project/lazimp/0.0.2/
0.0.1
Features
- ⭐ Lazy loading of sub-packages and modules.
Full Changelog: https://github.com/Vikka/lazimport/commits/0.0.1
Pypi release: https://pypi.org/project/lazimp/0.0.1/