Skip to content

Conversation

@UmbralReaper
Copy link

@UmbralReaper UmbralReaper commented May 3, 2021

This is my attempt to clean up the login in __init__.py. It fixes #230, and also performs a general cleanup of the file. I'll also attempt to merge some of the functionality from #156 into this.

The biggest change currently is that if the user specifies a specific QT_API, and it is not found, a PythonQtInvalidBinding RuntimeError wil be raised instead of a RuntimeWarning.

@UmbralReaper UmbralReaper changed the title Rewrite __init__.py. Improve __init__.py. May 3, 2021
@UmbralReaper UmbralReaper marked this pull request as ready for review May 4, 2021 04:28
@ccordoba12 ccordoba12 added this to the v2.0.0 milestone Aug 23, 2021
@tlambert03
Copy link
Contributor

I agree, __init__ needs a lot of love. There was some additional possible cleanups in #247 that you might also have a look through and potentially incorporate here. in particular ... I think the If API == chain could be made cleaner. see here for example

qtpy/__init__.py Outdated

# Detecting if a binding was specified by the user
binding_specified = QT_API in os.environ
binding_specified = os.environ[QT_API] is not None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- binding_specified = os.environ[QT_API] is not None
+ binding_specified = os.environ.get(QT_API) is not None

@dalthviz dalthviz removed this from the v2.0.0 milestone Nov 1, 2021
@UmbralReaper
Copy link
Author

Most of the changes I wanted to merge have already been merged during the process of removing PyQt4 support.

@UmbralReaper UmbralReaper deleted the import-logic branch January 28, 2022 10:03
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.

5 participants