Skip to content

Remove backward-compatible imports when 4.0.0 released #17

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

Closed
dhalbert opened this issue Mar 20, 2019 · 3 comments · Fixed by #76
Closed

Remove backward-compatible imports when 4.0.0 released #17

dhalbert opened this issue Mar 20, 2019 · 3 comments · Fixed by #76

Comments

@dhalbert
Copy link
Contributor

Remove the try-import code that supports older versions of displayio et al when 4.0.0 is released as stable.

@kevinjwalters
Copy link
Contributor

kevinjwalters commented May 16, 2019

On a related note, we have been discussing in discord the usefulness of this in https://github.com/adafruit/Adafruit_CircuitPython_PyPortal/blob/master/adafruit_pyportal.py#L58

try:
    from adafruit_display_text.text_area import TextArea  # pylint: disable=unused-import
    print("*** WARNING ***\nPlease update your library bundle to the latest 'adafruit_display_text' version as we've deprecated 'text_area' in favor of 'label'")  # pylint: disable=line-too-long
except ImportError:
    from adafruit_display_text.Label import Label

The current behaviour for that is to print the warning which cannot be seen as it's only on screen for about 1/4 of a second before the raster display blanks it. The import then has polluted the the code in some way where it blows up later on with a NameError: name 'Label' is not defined. I'd say that should either be a "file exists" type test to avoid polluting import xor it should be a fatal error to a) make it visible and b) force user to address it.

(I had missed the step in instructions to delete the old files on CIRCUITPY in https://learn.adafruit.com/adabox011/updating-your-pyportal and based on forum discussion a small number of other users must have done the same: https://forums.adafruit.com/viewtopic.php?f=59&t=149573)

@ladyada
Copy link
Member

ladyada commented May 17, 2019

we're going to remove it soon when 4 is released which solves it, right?

@kevinjwalters
Copy link
Contributor

Yes, if you are referring to removing the import from adafruit_display_text.text_area.

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 a pull request may close this issue.

3 participants