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

Add error handling if import of info function in __init__.py fails #12952

Closed
wants to merge 4 commits into from

Conversation

Vuizur
Copy link

@Vuizur Vuizur commented Sep 3, 2023

Description

The info function import currently imports the entire CLI. So it imports packages like typer and requests and importing spacy fails if they are not available on the current system. When we run spacy on webassembly, we might not want to bundle all of these CLI libraries, and using requests requires currently an ugly workaround (https://github.com/koenvo/pyodide-http) and the other CLI libraries can't really be used as of now and would be "dead weight". In the case of failure, by replacing info with a placeholder function that raises an error when it is attempted to be used, we can simply use spacy as is.

Types of change

Bug fix

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

@Vuizur Vuizur changed the title Add error handling if import of info function int __init__.py fails Add error handling if import of info function in __init__.py fails Sep 3, 2023
Co-authored-by: Hood Chatham <[email protected]>
@svlandeg svlandeg added the feat / ux Feature: User experience, error messages etc. label Sep 5, 2023
@Vuizur Vuizur closed this Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / ux Feature: User experience, error messages etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants