Skip to content

Don't import Micropython framebuf in Circuitpython #84

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
wants to merge 6 commits into from
Closed

Don't import Micropython framebuf in Circuitpython #84

wants to merge 6 commits into from

Conversation

RetiredWizard
Copy link

fixes #83

I suspect the import of framebuf.mpy was intended to allow this library to be used in Micropython, not for the Micropython version of framebuf.mpy to be used in Circuitpython.

@dhalbert
Copy link
Contributor

dhalbert commented Nov 4, 2023

See #77 and #78. It was to get it to work with Blinka.

@RetiredWizard
Copy link
Author

Ah, my last commit is probably still off the mark then... The first If should check for cpython. I'll update it again....

@RetiredWizard
Copy link
Author

Well not being all that familiar with Blinka, I guess I should ask is it possible to use either the Micropython OR the Circuitpython version of framebuffer with this libarary when run under Blinka?

If so I should put the Try/Except block within the test for implementation.name == 'cpython' and only import adafruit_framebuf if the name is not 'cpython'.

@dhalbert
Copy link
Contributor

dhalbert commented Nov 4, 2023

Normally Blinka runs on top of CPython, but it can also run on top of MicroPython. (That was actually its very original use, but running on CPython became by far the more common use case.) So #77 is to be able to use the MicroPython framebuf when using this library with Blinka on top of MicroPython.

@RetiredWizard
Copy link
Author

RetiredWizard commented Nov 4, 2023

:laugh: Okay, so I need to check for all three cpython, micropython and circuitpython. I should probably also switch it so it trys the circuitpython library first when running under cpython.

Do you think this PR makes sense? I think the issue that initiated it, is also solved by simply removing the incompatible framebuf library from the device flash.

@RetiredWizard
Copy link
Author

Well the Build CI doesn't like multiple imports so maybe I should just give up....

@dhalbert
Copy link
Contributor

dhalbert commented Nov 4, 2023

Let's see what is going on with the OP in #83.

@RetiredWizard
Copy link
Author

I just saw your comment on the issue, that does change things a bit, this seems like much more of an edge case now and I've probably spent way too much time on it....

@dhalbert
Copy link
Contributor

dhalbert commented Nov 4, 2023

@RetiredWizard I'm closing this for now because the #83 problem may not be pervasive. We can always reopen it.

@dhalbert dhalbert closed this Nov 4, 2023
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.

"Incompatible .mpy file" error while using 8.x library version on CircuitPython 8.2.7
2 participants