Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Better handling of optional dependencies #49

Merged
merged 1 commit into from
May 17, 2024

Conversation

ghisvail
Copy link
Contributor

@ghisvail ghisvail commented May 14, 2024

Inspired by Pandas design, tweaked for medkit's needs.

  • Importing a missing optional dependency raises a ModuleNotFound error with a note suggesting installing the appropriate medkit extra. Should avoid frustrating back and forth install of missing dependencies in an exploratory environment like Jupyter, where each kernel restart can become quite costly.
  • Package level symbols from optional modules will not be imported in case of missing dependencies.

@ghisvail ghisvail force-pushed the ref/import-or-raise branch 15 times, most recently from 5ca2f69 to ca61b19 Compare May 17, 2024 13:14
@ghisvail ghisvail marked this pull request as ready for review May 17, 2024 14:15
@ghisvail ghisvail changed the title REF: Better handling of optional dependencies ENH: Better handling of optional dependencies May 17, 2024
@ghisvail ghisvail merged commit 1869a9f into medkit-lib:main May 17, 2024
8 checks passed
@ghisvail ghisvail deleted the ref/import-or-raise branch May 17, 2024 14:18
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.

None yet

1 participant