Python - pip requirements


#1

Hi

I’m working on a custom component for media_player, you can check it here and here

I’m now creating a fork from HA and will work on a pull request for the integration of the component.
However in a fresh installation I want it to install automatically the dependency of beautifulsoup.

I added the following to the component:
REQUIREMENTS = ['beautifulsoup4==4.6.0']

But python/pip is not installing the requirements.

Any help on this ?

Thanks in advance


#2

New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.


#3

Thanks

So i should remove that comment from the component and add the requirement to the requirements_all.txt.

Correct ?


#4

The platform needs the REQUIREMENTS entry.


#5

Thanks. It’s working. Add to import inside a method.
Just did a new pull request :slight_smile:


#6

Hi all, slightly off topic to the original OP but close enough to not create a new thread…
I can’t get the gen_requirements_all.py script to detect the requirements for my intesishome climate platform, although I have REQUIREMENTS defined in it.

Would appreciate any ideas on how to fix it.
Cheers
James


#7

Not sure why the script wasn’t detecting the requirement on my environment, but apparently it is in Travis, so I just needed to put the requirement in the correct place in the file (ordered by the requirement package name, not the platform/component name).