Closed basnijholt closed 4 years ago
@bendavid, please let me know what you think!
Do you plan on merging this?
If so, I will solve the merge conflicts (again) 😅😉
ping @bendavid
@bendavid, I rebased on top of master 👍
(again 😉)
Since python 3.6 has already been deprecated in home assistant (and is being removed in 0.104 I believe) we should make the requirement python 3.7 rather (I guess the pyupgrade hook also needs to be modified accordingly.)
There are definitely some bits here which don't work in python 3.6 (asyncio.create_task for example was only introduced in 3.7, even if that would be trivial to work around if it were really needed.)
Good one, I thought that everything that was used was in Python >=3.6.
No need to depend on 3.6 though, however, it should support 3.7 because of Home Assistant.
I have updated and pushed the code accordingly.
After installing the pre-commit hooks and trying to add a commit I get an error as below, so it looks like things are not quite working in a python 3.8 environment.
[INFO] Installing environment for https://github.com/ambv/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/home/bendavid/pylgdev/venv/bin/python3', '-mvirtualenv', '/home/bendavid/.cache/pre-commit/repo8oxyovvt/py_env-python3.7', '-p', 'python3.7')
return code: 3
expected return code: 0
stdout:
The path python3.7 (from --python=python3.7) does not exist
stderr: (none)
Check the log at /home/bendavid/.cache/pre-commit/pre-commit.log
Great! Thanks for merging 👍
Thanks a lot for picking up this project!
Just some small style changes and adding a CI that tests for the consistent style.
I can help you to enable it (or you can give me write access 😄)
I also made some simplifications of the code that was repeated.
I have also change the Python requirement back to Python >= 3.6, because it is needed to work with Home Assistant. Also, I didn't see any 3.8 only code.