Bug 36270 - aiohttp.* are not importable
Summary: aiohttp.* are not importable
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: python3-module-aiohttp (show other bugs)
Version: unstable
Hardware: all Linux
: P3 normal
Assignee: Антон Мидюков
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-13 04:24 MSK by Ivan Zakharyaschev
Modified: 2019-03-13 22:12 MSK (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Zakharyaschev 2019-03-13 04:24:57 MSK
First, look at https://lists.altlinux.org/pipermail/sisyphus-incominger/2019-March/522412.html :

	x86_64: NEW unmet dependencies detected:
python3-module-aiocouchdb#0.9.1-alt1	python3(aiohttp.errors) < 0
python3-module-aiocouchdb#0.9.1-alt1	python3(aiohttp.multidict) < 0

But they cannot be provided in Sisyphus even if we wanted to, because aiohttp.* are not importable due to cchardet:

[imz@team ~]$ hsh-install ~/hasher/ python3-module-aiohttp
[imz@team python-module-aiohttp.git]$ hsh-run --mount=/proc,/dev/pts ~/hasher/ -- python3 -c 'import aiohttp.multidict'
Traceback (most recent call last):
  File "/usr/lib64/python3/site-packages/aiohttp/client_reqrep.py", line 25, in <module>
    import cchardet as chardet
ModuleNotFoundError: No module named 'cchardet'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python3/site-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import *  # noqa
  File "/usr/lib64/python3/site-packages/aiohttp/client.py", line 15, in <module>
    from . import connector as connector_mod
  File "/usr/lib64/python3/site-packages/aiohttp/connector.py", line 18, in <module>
    from .client_reqrep import ClientRequest
  File "/usr/lib64/python3/site-packages/aiohttp/client_reqrep.py", line 27, in <module>
    import chardet
ModuleNotFoundError: No module named 'chardet'
[imz@team python-module-aiohttp.git]$ hsh-run --mount=/proc,/dev/pts ~/hasher/ -- python3 -c 'import aiohttp.errors'
Traceback (most recent call last):
  File "/usr/lib64/python3/site-packages/aiohttp/client_reqrep.py", line 25, in <module>
    import cchardet as chardet
ModuleNotFoundError: No module named 'cchardet'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python3/site-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import *  # noqa
  File "/usr/lib64/python3/site-packages/aiohttp/client.py", line 15, in <module>
    from . import connector as connector_mod
  File "/usr/lib64/python3/site-packages/aiohttp/connector.py", line 18, in <module>
    from .client_reqrep import ClientRequest
  File "/usr/lib64/python3/site-packages/aiohttp/client_reqrep.py", line 27, in <module>
    import chardet
ModuleNotFoundError: No module named 'chardet'
[imz@team python-module-aiohttp.git]$ hsh-run --mount=/proc,/dev/pts ~/hasher/ -- python3 -c 'import aiohttp'
Traceback (most recent call last):
  File "/usr/lib64/python3/site-packages/aiohttp/client_reqrep.py", line 25, in <module>
    import cchardet as chardet
ModuleNotFoundError: No module named 'cchardet'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python3/site-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import *  # noqa
  File "/usr/lib64/python3/site-packages/aiohttp/client.py", line 15, in <module>
    from . import connector as connector_mod
  File "/usr/lib64/python3/site-packages/aiohttp/connector.py", line 18, in <module>
    from .client_reqrep import ClientRequest
  File "/usr/lib64/python3/site-packages/aiohttp/client_reqrep.py", line 27, in <module>
    import chardet
ModuleNotFoundError: No module named 'chardet'

Deleting these two packages would mean also deleting recursively:

$ join /beehive/stats/Sisyphus-x86_64/ufb-2 -1 2 - -o 1.1 <<<python3-module-aiohttp
python-module-aio2gis
python-module-aiohttp_jinja2
python-module-aioxmlrpc
python-module-grapy
python-module-motor
python-module-pytest-aiohttp
$ 

and further transitively via ufb. (I don't how many packages would be in the final list.)

I think it's OK to delete them because they don't work.
Comment 1 Ivan A. Melnikov 2019-03-13 11:43:13 MSK
> ModuleNotFoundError: No module named 'cchardet'

`ccharted` is only mentioned in client_reqrep.py in the following construct:

try:
    import cchardet as chardet
except ImportError:  # pragma: no cover
    import chardet

`python.req` usually ignores such constructions, so this package is missing dependency on python3(chardet). If you install pythno3-module-chardet in your hasher, aiohttp kind of works. This dependency should, of course, be added.

`aiohttp.multidit` is another story -- there is no such submodule in python3-module-aiohttp-2.2.5-alt1.1.1, nor in upstream master (https://github.com/aio-libs/aiohttp/tree/master/aiohttp). aiocouchdb requires aiohttp==0.17.4 and apparently won't work with more recent versions, so it should be removed.
Comment 2 Ivan Zakharyaschev 2019-03-13 12:47:39 MSK
(In reply to comment #1)
> > ModuleNotFoundError: No module named 'cchardet'
> 
> `ccharted` is only mentioned in client_reqrep.py in the following construct:
> 
> try:
>     import cchardet as chardet
> except ImportError:  # pragma: no cover
>     import chardet
> 
> `python.req` usually ignores such constructions, so this package is missing
> dependency on python3(chardet). If you install pythno3-module-chardet in your
> hasher, aiohttp kind of works. This dependency should, of course, be added.

Thank you for your interesting invetsigation!

Another variant of the solution: simplify this code with a patch (remove "try").

> `aiohttp.multidit` is another story -- there is no such submodule in
> python3-module-aiohttp-2.2.5-alt1.1.1, nor in upstream master
> (https://github.com/aio-libs/aiohttp/tree/master/aiohttp). aiocouchdb requires
> aiohttp==0.17.4 and apparently won't work with more recent versions, so it
> should be removed.

OK.
Comment 3 Антон Мидюков 2019-03-13 19:52:26 MSK
[#224917] DONE del=python-module-aiocouchdb

Close as notabug?
Comment 4 Ivan Zakharyaschev 2019-03-13 20:36:53 MSK
(In reply to comment #3)
> [#224917] DONE del=python-module-aiocouchdb
> 
> Close as notabug?

No, aiocouchdb was just a trigger for looking at aiohttp.

The problem remains:

(In reply to comment #0)

> aiohttp.*
> are not importable due to cchardet:
> 
> [imz@team ~]$ hsh-install ~/hasher/ python3-module-aiohttp
> [imz@team python-module-aiohttp.git]$ hsh-run --mount=/proc,/dev/pts ~/hasher/
> -- python3 -c 'import aiohttp'
> Traceback (most recent call last):
>   File "/usr/lib64/python3/site-packages/aiohttp/client_reqrep.py", line 25, in
> <module>
>     import cchardet as chardet
> ModuleNotFoundError: No module named 'cchardet'
> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
>   File "/usr/lib64/python3/site-packages/aiohttp/__init__.py", line 6, in
> <module>
>     from .client import *  # noqa
>   File "/usr/lib64/python3/site-packages/aiohttp/client.py", line 15, in
> <module>
>     from . import connector as connector_mod
>   File "/usr/lib64/python3/site-packages/aiohttp/connector.py", line 18, in
> <module>
>     from .client_reqrep import ClientRequest
>   File "/usr/lib64/python3/site-packages/aiohttp/client_reqrep.py", line 27, in
> <module>
>     import chardet
> ModuleNotFoundError: No module named 'chardet'
Comment 5 Repository Robot 2019-03-13 22:12:11 MSK
python-module-aiohttp-2.2.5-alt2 -> sisyphus:

Thu Mar 14 2019 Anton Midyukov <antohami@altlinux> 2.2.5-alt2
- Added py3_requires chardet (Closes: 36270)
- Cleanup spec