I have setup a development system on Ubuntu under Windows 10. I read the docs and followed the steps. My new component is under: homeassistant/components/rainforest and it contains:
- init.py
- manifest.json
- sensor.py
I ran the ‘python3 -m script.gen_requirements_all’ which added:
homeassistant.components.rainforest_eagle
eagle200_reader==0.1.4
To the ‘requirements_all.txt’ file.
I updated the ‘.coveragerc’ file to exclude my platform as I didn’t create any tests and as well it using an external library to communicate with a device.
homeassistant/components/rainforest/sensor.py
When I run the ‘tox’ command when it gets to pylint I see the external eagle200_reader library in the output.
pylint installdeps: -r/home/home/home-assistant/requirements_all.txt, -r/home/home/home-assistant/requirements_test.txt, -c/home/home/home-assistant/homeassistant/package_constraints.txt
....
,eagle200-reader==0.1.4,
.....
The summary of the tox command has a few errors but none are for an import
***** ERROR
Tests are leaving files behind. Please update the tests to avoid writing any files:
homeassistant/components/rainforest_eagle/__init__.py
homeassistant/components/rainforest_eagle/manifest.json
homeassistant/components/rainforest_eagle/sensor.py
ERROR: InvocationError for command /home/home/home-assistant/script/check_dirty (exited with code 1)
_________________________________________________ summary __________________________________________________
ERROR: py35: commands failed
ERROR: py36: commands failed
ERROR: py37: commands failed
ERROR: py38: commands failed
lint: commands succeeded
pylint: commands succeeded
ERROR: typing: commands failed
ERROR: cov: commands failed
(venv) home@DiningRoomPC:~/home-assistant$
When I run pylint outside of tox I get the import error. I ran the pip3 install as how it says in the online docs
pip3 install -r requirements_test_all.txt -c homeassistant/package_constraints.txt
But the output does not list it getting the eagle200_reader library. Is this because I’m using the requirements_test_all.txt and not the requirements_all.txt file?
pylint homeassistant/components/rainforest_eagle/sensor.py
************* Module homeassistant.components.rainforest_eagle.sensor
homeassistant/components/rainforest_eagle/sensor.py:83:8: E0401: Unable to import 'eagle200_reader' (import-error)
------------------------------------------------------------------
Your code has been rated at 8.65/10 (previous run: 8.65/10, +0.00)
Any pointers would be helpful! As well the sensor code I’m using is not yet posted to HA github repository, but I am copying it from my personal repository https://github.com/gtdiehl/rainforest_eagle if you want to see the 3 files I mentioned earlier.
Again thank you for any help
Greg