-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Simplify initialization #18
Conversation
I agree that an |
Also, we may call |
You're right. That sucks. Well, we can always contribute a hook to the pyinstaller repo to make it work out of the box.
Great idea! Just like matplotlib's |
A similar discussion arguably goes for the gui backend. I just experimented with this a bit. By explicitly importing
I don't think that will help, because we still need a way to specify what backend to include, so this will probably be the end-user juggling What about:
|
Sounds good. |
I'll reject this PR, since no changes are needed given your latest suggestion. I created #25 to track pyinstaller support. |
We'd still need a hook in |
That wouldn't be pyinstaller compatible though. I'm not sure how I feel about that... :/ it feels like setting the user up for a gotcha |
We can document what's needed to freeze an app containing wgpu. And in that code inside |
I felt like the backend import mechanism is a good fit for our needs internally, but harder than it needs to be for users. So I left the import mechanism intact, but provided an
init
function on the root module for users. Advantages:import wgpu
and callwgpu.init()
to get started right away, without needing to make a choice of backend (Rust is the default). I think this will be just fine for the majority of users.backend
kwarg toinit
. Example:wgpu.init(backend='js')
(I also removed
os.environ["RUST_BACKTRACE"] = "0"
since that is something both developers and users should be able to set on their environment, rather than in code.)