Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yarl removed unquote #11906

Closed
tiagoboldt opened this issue Jan 25, 2018 · 19 comments
Closed

Yarl removed unquote #11906

tiagoboldt opened this issue Jan 25, 2018 · 19 comments

Comments

@tiagoboldt
Copy link

yarl version >= 1.0 has removed unquote from it, which home assistant uses, resulting in an import error.

Example of a problematic import:

Jan 25 02:35:01 rpi hass[10212]:   File "/usr/lib/python3.6/site-packages/homeassistant/components/http/static.py", line 9, in <module>
Jan 25 02:35:01 rpi hass[10212]:     from yarl import unquote
Jan 25 02:35:01 rpi hass[10212]: ImportError: cannot import name 'unquote'

aiohttp has fixed this issue here: aio-libs/aiohttp#2662
Homeassistant should also make the required changes to work with the newer version of yarl.

@fabaff
Copy link
Member

fabaff commented Jan 25, 2018

See #11660

@tiagoboldt
Copy link
Author

tiagoboldt commented Jan 25, 2018

Thanks @fabaff. I believe the plan is to delay a fix for when aiohttp releases version 3.0. That has no fixed date by with version 2.3.8 (2018-01-15) they've already implemented yarl >= 1.0.0 compatibility. Doesn't it make sense to have home-assistant do the same.
I can downgrade my versions while this happens, but most users probably can't or won't and will have their system's broken due to some third-party update.

@caffeineflo
Copy link

@tiagoboldt What downgrade do you actually do?
I see the same issue but if I downgrade yarl from 1.0.0.0 to 0.16 home-assistant will complain that it needs yarl 1.0 and higher.
I'd like to get the automation center I'm relying on working again

@balloob
Copy link
Member

balloob commented Jan 27, 2018

Which version of Home Assistant are you using? This issue is not present in the latest version of Home Assistant.

@tiagoboldt
Copy link
Author

@caffeineflo You would have to downgrade home assistant and its dependencies. @balloob 0.61.1-1 (from https://aur.archlinux.org/packages/home-assistant/)

@tiagoboldt
Copy link
Author

@balloob
Copy link
Member

balloob commented Jan 27, 2018

YARL 1.0 is never installed by Home Assistant. Our version is pinned to 0.18: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/package_constraints.txt#L9

kamaradclimber added a commit to kamaradclimber/home-assistant-aur that referenced this issue Jan 27, 2018
Fix home-assistant/core#11906 until it is fixed upstream.
Main issue comes from archlinux aur package for yarl being more to date
than home-assistant dependency.
@tiagoboldt
Copy link
Author

@balloob if yarl is installed using the system's package manager, which I believe must be true for most users, when the new version comes out yarl is automatically updated.
@kamaradclimber fixed this downstream by removing the use of unquote from yarl at kamaradclimber/home-assistant-aur@e28a963

@fabaff
Copy link
Member

fabaff commented Jan 27, 2018

Arch Linux is pretty much the only distribution that ships Home Assistant. I'm wondering how they handle the other dependencies as usually users are not allow to write to site-packages and using pip and the distributions's management tools is often the issue of broken installations. Or perhaps this is only an issue on RPM-based distributions.

@balloob
Copy link
Member

balloob commented Jan 27, 2018

Most users do not install Home Assistant via a package manager but use the Hass.io installation, Docker container or install in a virtual environment (via Hassbian or manually).

If you have a patch to fix it downstream, consider opening a PR to fix it in Home Assistant.

@tobiasKaminsky
Copy link

tobiasKaminsky commented Jan 28, 2018

I installed/migrated from an older version hass via https://home-assistant.io/docs/installation/virtualenv/ and I also get

ImportError: cannot import name 'unquote'

My base system is Ubuntu 16.04.2 LTS, but as I run it in virtual env, this should be independent.
In my env directory a "find | grep yarl" only shows 0.18.0.

EDIT: somehow hass was accessing some remaints in ~/.local
After removing those it works

@dotlambda
Copy link
Contributor

@fabaff I just want to mention that Nixpkgs now ships Home Assistant as well: NixOS/nixpkgs#34188.
We solve this issue by making hass use a different version of yarl. However, it would be nice to use the default one.

@balloob
Copy link
Member

balloob commented Feb 2, 2018

However, it would be nice to use the default one.

Home Assistant requires Yarl 0.18, as specified in our requirements:

https://github.com/home-assistant/home-assistant/blob/730e0a0094b84b3adb4cd6664a84eb07c1bbc75c/setup.py#L48-L61

Feel free to submit a PR to upgrade Home Assistant to use Yarl 1.0 and fix any issues that arise.

Going to close this issue since Home Assistant does not support working with Yarl 1.0, as we specify 0.18 for a good reason.

@balloob balloob closed this as completed Feb 2, 2018
@tiagoboldt
Copy link
Author

@balloob asking for the PR makes perfect sense to me, closing the issue without having in place a proper solution, admittedly knowing that the current setup is troublesome for most linux flavor packaging tools doesn't. As more have met the same issue, do expect new people reporting it in the future :/

@balloob
Copy link
Member

balloob commented Feb 2, 2018

We use our issue tracker solely for bugs (and still it's too much to handle). By closing it, it is clear that it's not an issue that you should expect the core team to fix. As always, a PR is welcome.

@gretel
Copy link

gretel commented Feb 6, 2018

i ran into this issue by upgrading homeassistant which i probably should not have done reading over this debate.

me using a virtualenv so i did

$ cd homeassistant
$ . bin/activate
$ pip install yarl==0.18.0 

to "fix" this issue on debian/buster.

@balloob
Copy link
Member

balloob commented Feb 9, 2018

#12244

@pvizeli pvizeli reopened this Feb 10, 2018
@balloob
Copy link
Member

balloob commented Feb 10, 2018

Why did you reopen?

@pvizeli pvizeli closed this as completed Feb 10, 2018
@pvizeli
Copy link
Member

pvizeli commented Feb 10, 2018

I don't know 😟

@home-assistant home-assistant locked and limited conversation to collaborators May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants