Need help with python based port (home assistant)

Mateusz Piotrowski 0mp at FreeBSD.org
Mon Nov 23 18:35:47 UTC 2020


Hi,

On 11/23/20 4:28 AM, Rozhuk Ivan wrote:
> Hi!
>
> Im trying to make Home Assistant port.
>
> It requires many deps:
> https://github.com/home-assistant/core/blob/dev/setup.py
>      "aiohttp==3.7.1",
>      "astral==1.10.1",
>      "async_timeout==3.0.1",
>      "attrs==19.3.0",
>      "bcrypt==3.1.7",
>      "certifi>=2020.6.20",
>      "ciso8601==2.1.3",
>      "httpx==0.16.1",
>      "importlib-metadata==1.6.0;python_version<'3.8'",
>      "jinja2>=2.11.2",
>      "PyJWT==1.7.1",
>      # PyJWT has loose dependency. We want the latest one.
>      "cryptography==3.2",
>      "pip>=8.0.3",
>      "python-slugify==4.0.1",
>      "pytz>=2020.1",
>      "pyyaml==5.3.1",
>      "requests==2.25.0",
>      "ruamel.yaml==0.15.100",
>      "voluptuous==0.12.0",
>      "voluptuous-serialize==2.4.0",
>      "yarl==1.4.2",
>
> we have most of them, but many ports have different versions.
>
> I made a hack:
> post-patch:
> 	@${REINPLACE_CMD} -e 's|requests==2.25.0|requests>=2.22.0|g' \
> 		-e 's|cryptography==3.2|cryptography>=2.6.1|g' \
> 		-e 's|aiohttp==3.7.1|aiohttp>=3.6.2|g' \
> 		-e 's|==|>=|g' \
> 		${WRKSRC}/setup.py
> it force to use newer versions and make few downgrades.
> With this HA install and start.
> But on first start it show errors in console and download and install
> some python packets that was hacked version and some packets that
> was not in requires list.
> (I suspest it set as deps in plugins/componets)
>
>
> Questions:
>
> 1. Is it ok that I use hack to change required deps versions?
> Or how to deal with it?
It is OK to change the required deps as long as the program keeps working. Sometimes, however, we 
just add new ports for the specific desired versions of the dependencies (e.g., 
py37-sphinxcontrib-websupport11 and py37-sphinxcontrib-websupport).
> 2. Is it ok that HA download all deps that required into HA
> work dir?
> Should I add all these deps in port to prevent this?
If I understand correctly, HA is missing some runtime dependencies. Each runtime dependency should 
be specified (e.g., via RUN_DEPENDS).


More information about the freebsd-ports mailing list