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

"import luma.emulator.device" fails #19

Closed
leonidlezner opened this issue Sep 5, 2017 · 3 comments
Closed

"import luma.emulator.device" fails #19

leonidlezner opened this issue Sep 5, 2017 · 3 comments
Assignees
Labels

Comments

@leonidlezner
Copy link

Hello Richard,

it seems that serial.py is missing in the master branch in luma.core (the file is present in the develop branch). Because of that following import fails:

ModuleNotFoundError: No module named 'luma.emulator.devices'
>>> import luma.emulator.device
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/leonidlezner/Envs/ledmatrix/lib/python3.6/site-packages/luma/emulator/device.py", line 20, in <module>
    from luma.core.serial import noop
ModuleNotFoundError: No module named 'luma.core.serial'
>>> import luma.core.serial
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'luma.core.serial'

@thijstriemstra
Copy link
Collaborator

It should import luma.core.interface.serial.noop instead (since v1.0), so you're right, this is a bug (and I'm surprised this wasn't caught by unit tests before).

See https://github.com/rm-hull/luma.core/blob/master/luma/core/interface/serial.py

@thijstriemstra thijstriemstra self-assigned this Sep 5, 2017
@thijstriemstra
Copy link
Collaborator

Tests are actually catching the error, I guess they just haven't been run since luma.core 1.0:

____________________________________ ERROR collecting tests/test_gifanim.py _____________________________________
ImportError while importing test module '/home/thijs/luma.emulator/tests/test_gifanim.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_gifanim.py:16: in <module>
    from luma.emulator.device import gifanim
luma/emulator/device.py:20: in <module>
    from luma.core.serial import noop
E   ImportError: No module named serial

thijstriemstra added a commit that referenced this issue Sep 5, 2017
rm-hull pushed a commit that referenced this issue Sep 6, 2017
* correct noop import (fixes #19)
* require luma.core 1.0.0 or newer
* add test for clut module
* add segment_mapper test

* add more emulator tests
@rm-hull
Copy link
Owner

rm-hull commented Sep 6, 2017

I pushed v0.2.5 of luma.emulator to pypi with @thijstriemstra's fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants