Closed p1r473 closed 3 years ago
Looks like the build is failing with
FileNotFoundError: [Errno 2] No such file or directory: '/proc/device-tree/model'
Perhaps the error checker does not have this file. However, my TinkerBoard 1 + 2 and the Pi have this
I've reimplemented the try:except so the build works.
I am ready for a re-review Thanks,
Seems to be failing with
rpi_backlight/utils.py:1: error: Module "__future__" has no attribute "annotations"
Found 1 error in 1 file (checked 9 source files)
Error: Process completed with exit code 1.
Without
from __future__ import annotations
I get
root@Harbormaster:/home/linaro/rpi-backlight# python3 setup.py install;
Traceback (most recent call last):
File "setup.py", line 2, in <module>
from rpi_backlight import __version__
File "/home/linaro/rpi-backlight/rpi_backlight/__init__.py", line 10, in <module>
from . import utils
File "/home/linaro/rpi-backlight/rpi_backlight/utils.py", line 11, in <module>
def detect_board_type() -> Optional[BoardType]:
NameError: name 'BoardType' is not defined
According to https://stackoverflow.com/questions/46641078/how-to-avoid-circular-dependency-caused-by-type-hinting-of-pointer-attributes-in this import is required to allow for names to not be evaluated at compilation
Looks like it may be Python 3.7+ only
oh, hmm. Let's remove the annotations import then and make the return type Optional["BoardType"]
, as a string. I'm not used to this old Python anymore :D
Thanks Linus for your guidance As you can tell I am not as good at Python as you, so I am thankful for your teachings. I learned a lot this round! Thanks,
Hi, I've removed the unused import and ready for the final review Thanks,
https://github.com/linusg/rpi-backlight/pull/32#discussion_r650251704
Please add the comma and restore the original formatting :)
Fixed the version parser argument formatting, thanks!
:rocket:
Hi Linus, I have taken a stab at implementation. It works!
A few points for you to review -I am not sure if I did the enumeration to your liking. -I removed the part in the readme, now that it works out of the box. -After I blacked the files, it rearranged the whitespace on your argument parser -I didnt know if I should put the _get_board in the Backlight class. I'm not very good with OOP, so I was not able to access it with self._get_board(). My guess is because it hasn't been init'd yet.
Thanks,
Fixes #30