ManderaGeneral / generalimport

Handle all your optional dependencies with a single call!
https://pypi.org/project/generalimport/
Apache License 2.0
16 stars 1 forks source link

Custom error messages for missing dependencies #33

Closed ZanSara closed 1 year ago

ZanSara commented 1 year ago

Fixes https://github.com/ManderaGeneral/generalimport/issues/32. Backwards compatible.

Added unit test. Also removes a stray line that was probably in the is_imported PR: sorry for that! :see_no_evil:

Usecase:

generalimport(("hi", "Get 'hi' with 'pip install python-hi'."))
import hi

hi.greet()
# MissingOptionalDependency: Optional dependency 'hi' was used but it isn't installed. Get 'hi' with 'pip install python-hi'.